diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-01 05:42:38 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-03 11:39:52 +0000 |
commit | 64c08801e0ac5094fb111c5fe3ea63cc7597506d (patch) | |
tree | a34f000d2743b864e22e322d9ce94b655c86ac97 /searchcore/src/tests/proton/matching | |
parent | 6f78fdc9750ad3ac03b14166b6838c628487458c (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 'searchcore/src/tests/proton/matching')
-rw-r--r-- | searchcore/src/tests/proton/matching/matching_test.cpp | 6 | ||||
-rw-r--r-- | searchcore/src/tests/proton/matching/request_context/request_context_test.cpp | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index 09bb67dbac9..187c0463da3 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -8,7 +8,6 @@ #include <vespa/searchcore/proton/documentmetastore/documentmetastore.h> #include <vespa/searchcore/proton/matching/fakesearchcontext.h> #include <vespa/searchcore/proton/matching/i_constant_value_repo.h> -#include <vespa/searchcore/proton/matching/isearchcontext.h> #include <vespa/searchcore/proton/matching/matcher.h> #include <vespa/searchcore/proton/matching/querynodes.h> #include <vespa/searchcore/proton/matching/sessionmanager.h> @@ -37,6 +36,7 @@ #include <vespa/eval/eval/tensor_spec.h> #include <vespa/eval/eval/value_codec.h> #include <vespa/vespalib/objects/nbostream.h> +#include <vespa/vespalib/util/testclock.h> #include <vespa/log/log.h> LOG_SETUP("matching_test"); @@ -120,7 +120,7 @@ struct MyWorld { SessionManager::SP sessionManager; DocumentMetaStore metaStore; MatchingStats matchingStats; - vespalib::Clock clock; + vespalib::TestClock clock; QueryLimiter queryLimiter; EmptyConstantValueRepo constantValueRepo; @@ -344,7 +344,7 @@ struct MyWorld { } Matcher::SP createMatcher() { - return std::make_shared<Matcher>(schema, config, clock, queryLimiter, constantValueRepo, RankingExpressions(), OnnxModels(), 0); + return std::make_shared<Matcher>(schema, config, clock.clock(), queryLimiter, constantValueRepo, RankingExpressions(), OnnxModels(), 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 8ede5277d71..191c1718f61 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 @@ -6,6 +6,7 @@ #include <vespa/searchcore/proton/matching/requestcontext.h> #include <vespa/searchlib/attribute/attribute_blueprint_params.h> #include <vespa/searchlib/fef/properties.h> +#include <vespa/vespalib/util/testclock.h> #include <vespa/vespalib/gtest/gtest.h> #include <vespa/vespalib/objects/nbostream.h> @@ -29,7 +30,7 @@ public: class RequestContextTest : public ::testing::Test { private: - vespalib::Clock _clock; + vespalib::TestClock _clock; vespalib::Doom _doom; MyAttributeContext _attr_ctx; Properties _props; @@ -45,7 +46,7 @@ private: public: RequestContextTest() : _clock(), - _doom(_clock, vespalib::steady_time(), vespalib::steady_time(), false), + _doom(_clock.clock(), vespalib::steady_time(), vespalib::steady_time(), false), _attr_ctx(), _props(), _request_ctx(_doom, _attr_ctx, _props, AttributeBlueprintParams()), |