summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-12-15 15:44:55 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-12-15 15:49:37 +0000
commit3a1502c2e21eec47d34d73bb5ba641dfec51a5c2 (patch)
tree10ad6d5d3d4d49b89f32f2ef974e1aad2e64a5e6 /searchcore/src/tests
parent28f8cf3e298d51ca703ceee36a992297d38637cc (diff)
Remove most of the now void clock indirection.
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/grouping/grouping_test.cpp24
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp4
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp1
-rw-r--r--searchcore/src/tests/proton/index/indexcollection_test.cpp3
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp2
-rw-r--r--searchcore/src/tests/proton/matching/request_context/request_context_test.cpp2
7 files changed, 18 insertions, 20 deletions
diff --git a/searchcore/src/tests/grouping/grouping_test.cpp b/searchcore/src/tests/grouping/grouping_test.cpp
index 951b0bf2857..905384416e6 100644
--- a/searchcore/src/tests/grouping/grouping_test.cpp
+++ b/searchcore/src/tests/grouping/grouping_test.cpp
@@ -178,7 +178,7 @@ TEST_F("testGroupingContextInitialization", DoomFixture()) {
baseRequest.serialize(nos);
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom, os.data(), os.size());
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom, os.data(), os.size());
ASSERT_TRUE(!context.empty());
GroupingContext::GroupingList list = context.getGroupingList();
ASSERT_TRUE(list.size() == 1);
@@ -209,7 +209,7 @@ TEST_F("testGroupingContextUsage", DoomFixture()) {
auto r1 = std::make_shared<Grouping>(request1);
auto r2 = std::make_shared<Grouping>(request2);
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom);
ASSERT_TRUE(context.empty());
context.addGrouping(r1);
ASSERT_TRUE(context.getGroupingList().size() == 1);
@@ -232,7 +232,7 @@ TEST_F("testGroupingContextSerializing", DoomFixture()) {
baseRequest.serialize(nos);
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom);
auto bp = std::make_shared<Grouping>(baseRequest);
context.addGrouping(bp);
context.serialize();
@@ -251,7 +251,7 @@ TEST_F("testGroupingManager", DoomFixture()) {
.addLevel(createGL(MU<AttributeNode>("attr2"), MU<AttributeNode>("attr3")));
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom);
auto bp = std::make_shared<Grouping>(request1);
context.addGrouping(bp);
GroupingManager manager(context);
@@ -285,7 +285,7 @@ TEST_F("testGroupingSession", DoomFixture()) {
auto r1 = std::make_shared<Grouping>(request1);
auto r2 = std::make_shared<Grouping>(request2);
- GroupingContext initContext(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext initContext(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
initContext.addGrouping(r1);
initContext.addGrouping(r2);
SessionId id("foo");
@@ -317,7 +317,7 @@ TEST_F("testGroupingSession", DoomFixture()) {
}
// Test second pass
{
- GroupingContext context(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
auto r = std::make_shared<Grouping>(request1);
r->setFirstLevel(1);
r->setLastLevel(1);
@@ -328,7 +328,7 @@ TEST_F("testGroupingSession", DoomFixture()) {
}
// Test last pass. Session should be marked as finished
{
- GroupingContext context(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
auto r = std::make_shared<Grouping>(request1);
r->setFirstLevel(2);
r->setLastLevel(2);
@@ -351,7 +351,7 @@ TEST_F("testEmptySessionId", DoomFixture()) {
.addLevel(createGL(MU<AttributeNode>("attr2"), MU<AttributeNode>("attr3")));
auto r1 = std::make_shared<Grouping>(request1);
- GroupingContext initContext(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext initContext(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
initContext.addGrouping(r1);
SessionId id;
@@ -383,7 +383,7 @@ TEST_F("testSessionManager", DoomFixture()) {
.setResult(Int64ResultNode(0))));
auto r1 = std::make_shared<Grouping>(request1);
- GroupingContext initContext(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext initContext(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
initContext.addGrouping(r1);
SessionManager mgr(2);
@@ -440,7 +440,7 @@ TEST_F("test grouping fork/join", DoomFixture()) {
.setLastLevel(1);
auto g1 = std::make_shared<Grouping>(request);
- GroupingContext context(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
context.addGrouping(g1);
GroupingSession session(SessionId(), context, world.attributeContext);
session.prepareThreadContextCreation(4);
@@ -481,8 +481,8 @@ TEST_F("test session timeout", DoomFixture()) {
SessionId id1("foo");
SessionId id2("bar");
- GroupingContext initContext1(world.bv, f1.clock.clock(), steady_time(duration(10)));
- GroupingContext initContext2(world.bv, f1.clock.clock(), steady_time(duration(20)));
+ GroupingContext initContext1(world.bv, f1.clock.nowRef(), steady_time(duration(10)));
+ GroupingContext initContext2(world.bv, f1.clock.nowRef(), steady_time(duration(20)));
auto s1 = std::make_unique<GroupingSession>(id1, initContext1, world.attributeContext);
auto s2 = std::make_unique<GroupingSession>(id2, initContext2, world.attributeContext);
mgr.insert(std::move(s1));
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 90c08d2eb19..2504bca17e4 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -202,7 +202,7 @@ Fixture::Fixture()
std::filesystem::create_directory(std::filesystem::path(BASE_DIR));
initViewSet(_views);
_configurer = std::make_unique<Configurer>(_views._summaryMgr, _views.searchView, _views.feedView, _queryLimiter,
- _constantValueFactory, _clock.clock(), "test", 0);
+ _constantValueFactory, _clock.nowRef(), "test", 0);
}
Fixture::~Fixture() = default;
@@ -212,7 +212,7 @@ Fixture::initViewSet(ViewSet &views)
using IndexManager = proton::index::IndexManager;
using IndexConfig = proton::index::IndexConfig;
RankingAssetsRepo ranking_assets_repo_source(_constantValueFactory, {}, {}, {});
- auto matchers = std::make_shared<Matchers>(_clock.clock(), _queryLimiter, ranking_assets_repo_source);
+ auto matchers = std::make_shared<Matchers>(_clock.nowRef(), _queryLimiter, ranking_assets_repo_source);
auto indexMgr = make_shared<IndexManager>(BASE_DIR, IndexConfig(searchcorespi::index::WarmupConfig(), 2, 0), Schema(), 1,
views._reconfigurer, views._service.write(), _summaryExecutor,
TuneFileIndexManager(), TuneFileAttributes(), views._fileHeaderContext);
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 596ebb933a4..da8e842b9e4 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -256,7 +256,7 @@ MySearchableContext::MySearchableContext(IThreadingService &writeService,
IBucketDBHandlerInitializer & bucketDBHandlerInitializer)
: _fastUpdCtx(writeService, bucketDB, bucketDBHandlerInitializer),
_queryLimiter(), _clock(),
- _ctx(_fastUpdCtx._ctx, _queryLimiter, _clock.clock(), writeService.shared())
+ _ctx(_fastUpdCtx._ctx, _queryLimiter, _clock.nowRef(), writeService.shared())
{}
MySearchableContext::~MySearchableContext() = default;
diff --git a/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp b/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp
index 322f3c389ad..8a354ded706 100644
--- a/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp
@@ -28,7 +28,6 @@ public:
field_writer_executor(SequencedTaskExecutor::create(my_field_writer_executor, 3, 200)),
service(std::make_unique<ExecutorThreadingService>(_transport.shared(),
_transport.transport(),
- _transport.clock(),
*field_writer_executor,
nullptr,
ThreadingServiceConfig::make()))
diff --git a/searchcore/src/tests/proton/index/indexcollection_test.cpp b/searchcore/src/tests/proton/index/indexcollection_test.cpp
index 24460000596..0e699fd1443 100644
--- a/searchcore/src/tests/proton/index/indexcollection_test.cpp
+++ b/searchcore/src/tests/proton/index/indexcollection_test.cpp
@@ -47,7 +47,6 @@ public:
std::shared_ptr<IndexSearchable> _source2;
std::shared_ptr<IndexSearchable> _fusion_source;
vespalib::ThreadStackExecutor _executor;
- vespalib::TestClock _clock;
std::shared_ptr<IndexSearchable> _warmup;
void expect_searchable_can_be_appended(ISearchableIndexCollection & collection) {
@@ -84,7 +83,7 @@ public:
std::shared_ptr<WarmupIndexCollection>
create_warmup(const IndexCollection::SP& prev, const IndexCollection::SP& next) {
- return std::make_shared<WarmupIndexCollection>(WarmupConfig(1s, false), prev, next, *_warmup, _executor, _clock.clock(), *this);
+ return std::make_shared<WarmupIndexCollection>(WarmupConfig(1s, false), prev, next, *_warmup, _executor, *this);
}
void warmupDone(std::shared_ptr<WarmupIndexCollection> current) override {
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 5f4f26c6c6b..02506afa709 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -356,7 +356,7 @@ struct MyWorld {
}
Matcher::SP createMatcher() {
- return std::make_shared<Matcher>(schema, config, clock.clock(), queryLimiter, constantValueRepo, 0);
+ return std::make_shared<Matcher>(schema, config, clock.nowRef(), queryLimiter, constantValueRepo, 0);
}
struct MySearchHandler : ISearchHandler {
diff --git a/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp b/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
index 8b223c3ef3a..36636d58429 100644
--- a/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
+++ b/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
@@ -53,7 +53,7 @@ private:
public:
RequestContextTest()
: _clock(),
- _doom(_clock.clock(), vespalib::steady_time(), vespalib::steady_time(), false),
+ _doom(_clock.nowRef(), vespalib::steady_time(), vespalib::steady_time(), false),
_thread_bundle(1),
_attr_ctx(),
_index_env(),