aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/queryeval
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-03-01 05:42:38 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-03-03 11:39:52 +0000
commit64c08801e0ac5094fb111c5fe3ea63cc7597506d (patch)
treea34f000d2743b864e22e322d9ce94b655c86ac97 /searchlib/src/tests/queryeval
parent6f78fdc9750ad3ac03b14166b6838c628487458c (diff)
Let the InvocationService drive the clock instead of having its own ticking loop.
Also use sleep_until to get intervals indendant of invoke cost as long as cost is within interval. This also also saves a clock sample and simplifies implementation.
Diffstat (limited to 'searchlib/src/tests/queryeval')
-rw-r--r--searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp b/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp
index 8879d591f5a..4877072eacd 100644
--- a/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp
+++ b/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp
@@ -9,6 +9,7 @@
#include <vespa/searchlib/fef/matchdatalayout.h>
#include <vespa/searchlib/query/tree/simplequery.h>
#include <vespa/searchlib/query/weight.h>
+#include <vespa/vespalib/util/testclock.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/log/log.h>
@@ -211,8 +212,8 @@ void Test::requireThatIteratorHonorsFutureDoom() {
test.addTerm("foo", 0).addTerm("bar", 1);
test.fetchPostings(false);
- vespalib::Clock clock;
- vespalib::Doom futureDoom(clock, vespalib::steady_time::max());
+ vespalib::TestClock clock;
+ vespalib::Doom futureDoom(clock.clock(), vespalib::steady_time::max());
unique_ptr<SearchIterator> search(test.createSearch(false));
static_cast<SimplePhraseSearch &>(*search).setDoom(&futureDoom);
EXPECT_TRUE(!search->seek(1u));
@@ -225,8 +226,8 @@ void Test::requireThatIteratorHonorsDoom() {
test.addTerm("foo", 0).addTerm("bar", 1);
test.fetchPostings(false);
- vespalib::Clock clock;
- vespalib::Doom futureDoom(clock, vespalib::steady_time());
+ vespalib::TestClock clock;
+ vespalib::Doom futureDoom(clock.clock(), vespalib::steady_time());
unique_ptr<SearchIterator> search(test.createSearch(false));
static_cast<SimplePhraseSearch &>(*search).setDoom(&futureDoom);
EXPECT_TRUE(!search->seek(1u));