summaryrefslogtreecommitdiffstats
path: root/searchlib
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 /searchlib
parent28f8cf3e298d51ca703ceee36a992297d38637cc (diff)
Remove most of the now void clock indirection.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/sortspec/multilevelsort_test.cpp17
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp3
2 files changed, 6 insertions, 14 deletions
diff --git a/searchlib/src/tests/sortspec/multilevelsort_test.cpp b/searchlib/src/tests/sortspec/multilevelsort_test.cpp
index 2d0456e13fc..f3bf363645e 100644
--- a/searchlib/src/tests/sortspec/multilevelsort_test.cpp
+++ b/searchlib/src/tests/sortspec/multilevelsort_test.cpp
@@ -8,7 +8,6 @@
#include <vespa/searchlib/attribute/attributemanager.h>
#include <vespa/searchlib/uca/ucaconverter.h>
#include <vespa/searchcommon/attribute/config.h>
-#include <vespa/vespalib/util/testclock.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <type_traits>
#include <cinttypes>
@@ -242,10 +241,8 @@ MultilevelSortTest::sortAndCheck(const std::vector<Spec> &specs, uint32_t num,
hits.emplace_back(i, getRandomValue<uint32_t>());
}
- vespalib::TestClock clock;
- vespalib::Doom doom(clock.clock(), vespalib::steady_time::max());
search::uca::UcaConverterFactory ucaFactory;
- FastS_SortSpec sorter("no-metastore", 7, doom, ucaFactory);
+ FastS_SortSpec sorter("no-metastore", 7, vespalib::Doom::never(), ucaFactory);
// init sorter with sort data
for (const auto & spec : specs) {
AttributeGuard ag;
@@ -384,10 +381,8 @@ TEST("require that all sort methods behave the same")
}
TEST("test that [docid] translates to [lid][paritionid]") {
- vespalib::TestClock clock;
- vespalib::Doom doom(clock.clock(), vespalib::steady_time::max());
search::uca::UcaConverterFactory ucaFactory;
- FastS_SortSpec asc("no-metastore", 7, doom, ucaFactory);
+ FastS_SortSpec asc("no-metastore", 7, vespalib::Doom::never(), ucaFactory);
RankedHit hits[2] = {RankedHit(91, 0.0), RankedHit(3, 2.0)};
search::AttributeManager mgr;
search::AttributeContext ac(mgr);
@@ -404,7 +399,7 @@ TEST("test that [docid] translates to [lid][paritionid]") {
EXPECT_EQUAL(6u, sr2.second);
EXPECT_EQUAL(0, memcmp(SECOND_ASC, sr2.first, 6));
- FastS_SortSpec desc("no-metastore", 7, doom, ucaFactory);
+ FastS_SortSpec desc("no-metastore", 7, vespalib::Doom::never(), ucaFactory);
desc.Init("-[docid]", ac);
desc.initWithoutSorting(hits, 2);
sr1 = desc.getSortRef(0);
@@ -416,10 +411,8 @@ TEST("test that [docid] translates to [lid][paritionid]") {
}
TEST("test that [docid] uses attribute when one exists") {
- vespalib::TestClock clock;
- vespalib::Doom doom(clock.clock(), vespalib::steady_time::max());
search::uca::UcaConverterFactory ucaFactory;
- FastS_SortSpec asc("metastore", 7, doom, ucaFactory);
+ FastS_SortSpec asc("metastore", 7, vespalib::Doom::never(), ucaFactory);
RankedHit hits[2] = {RankedHit(91, 0.0), RankedHit(3, 2.0)};
Config cfg(BasicType::INT64, CollectionType::SINGLE);
auto metastore = AttributeFactory::createAttribute("metastore", cfg);
@@ -445,7 +438,7 @@ TEST("test that [docid] uses attribute when one exists") {
EXPECT_EQUAL(8u, sr2.second);
EXPECT_EQUAL(0, memcmp(SECOND_ASC, sr2.first, 8));
- FastS_SortSpec desc("metastore", 7, doom, ucaFactory);
+ FastS_SortSpec desc("metastore", 7, vespalib::Doom::never(), ucaFactory);
desc.Init("-[docid]", ac);
desc.initWithoutSorting(hits, 2);
sr1 = desc.getSortRef(0);
diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp b/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp
index ae5a7583c8c..f15f3d0e84c 100644
--- a/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp
@@ -3,7 +3,6 @@
#include "fake_requestcontext.h"
#include <vespa/vespalib/util/testclock.h>
-
namespace search::queryeval {
FakeRequestContext::FakeRequestContext()
@@ -13,7 +12,7 @@ FakeRequestContext::FakeRequestContext()
FakeRequestContext::FakeRequestContext(attribute::IAttributeContext * context, vespalib::steady_time softDoom, vespalib::steady_time hardDoom)
: _clock(std::make_unique<vespalib::TestClock>()),
- _doom(_clock->clock(), softDoom, hardDoom, false),
+ _doom(_clock->nowRef(), softDoom, hardDoom, false),
_attributeContext(context),
_query_tensor_name(),
_query_tensor(),