summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-02-10 12:16:00 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-02-10 12:27:55 +0000
commit7cde1032d8c8dcf7e8a37ea477015e5c331fb56f (patch)
tree01b127684d6913f37e76eabaaeddf3c7d47dfc86 /searchcore/src/tests
parentae489bc7089f2873041fc76af82e21dad7090f2e (diff)
Refactor to splitt out work that can be done in separate thread.
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h11
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp12
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/scaniterator_test.cpp1
4 files changed, 13 insertions, 12 deletions
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h
index a7e568dc00f..4a6bb4fa938 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h
@@ -4,13 +4,12 @@
#include <vespa/searchcore/proton/bucketdb/bucket_create_notifier.h>
#include <vespa/searchcore/proton/test/bucketfactory.h>
#include <vespa/searchcore/proton/feedoperation/moveoperation.h>
-#include <vespa/searchcore/proton/server/bucketmovejob.h>
-#include <vespa/searchcore/proton/server/documentbucketmover.h>
#include <vespa/searchcore/proton/server/i_move_operation_limiter.h>
#include <vespa/searchcore/proton/server/idocumentmovehandler.h>
#include <vespa/searchcore/proton/server/imaintenancejobrunner.h>
#include <vespa/searchcore/proton/server/maintenancedocumentsubdb.h>
#include <vespa/searchcore/proton/server/ibucketmodifiedhandler.h>
+#include <vespa/searchcore/proton/server/i_maintenance_job.h>
#include <vespa/searchcore/proton/test/buckethandler.h>
#include <vespa/searchcore/proton/test/clusterstatehandler.h>
#include <vespa/searchcore/proton/test/disk_mem_usage_notifier.h>
@@ -124,6 +123,14 @@ struct MySubDb {
}
};
+struct MyCountJobRunner : public IMaintenanceJobRunner {
+ uint32_t runCount;
+ explicit MyCountJobRunner(IMaintenanceJob &job) : runCount(0) {
+ job.registerRunner(this);
+ }
+ void run() override { ++runCount; }
+};
+
bool
assertEqual(const document::BucketId &bucket, const proton::test::Document &doc,
uint32_t sourceSubDbId, uint32_t targetSubDbId, const MoveOperation &op);
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
index 70b173ece75..56cf1ae5389 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
@@ -1,7 +1,7 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bucketmover_common.h"
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/searchcore/proton/server/bucketmovejob.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/log/log.h>
@@ -57,14 +57,6 @@ struct MyFrozenBucketHandler : public IFrozenBucketHandler
}
};
-struct MyCountJobRunner : public IMaintenanceJobRunner {
- uint32_t runCount;
- explicit MyCountJobRunner(IMaintenanceJob &job) : runCount(0) {
- job.registerRunner(this);
- }
- void run() override { ++runCount; }
-};
-
struct ControllerFixtureBase : public ::testing::Test
{
test::UserDocumentsBuilder _builder;
@@ -152,7 +144,7 @@ ControllerFixtureBase::ControllerFixtureBase(const BlockableMaintenanceJobConfig
{
}
-ControllerFixtureBase::~ControllerFixtureBase() {}
+ControllerFixtureBase::~ControllerFixtureBase() = default;
constexpr double RESOURCE_LIMIT_FACTOR = 1.0;
constexpr uint32_t MAX_OUTSTANDING_OPS = 10;
const BlockableMaintenanceJobConfig BLOCKABLE_CONFIG(RESOURCE_LIMIT_FACTOR, MAX_OUTSTANDING_OPS);
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp
index 565050f1052..0d978e6e463 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp
@@ -1,6 +1,7 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bucketmover_common.h"
+#include <vespa/searchcore/proton/server/documentbucketmover.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/log/log.h>
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/scaniterator_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/scaniterator_test.cpp
index 75f5f7c7427..2c382473fca 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/scaniterator_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/scaniterator_test.cpp
@@ -1,6 +1,7 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bucketmover_common.h"
+#include <vespa/searchcore/proton/bucketdb/bucketscaniterator.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/log/log.h>