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/documentdb/document_subdbs | |
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/documentdb/document_subdbs')
-rw-r--r-- | searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 27636324835..68a92c73b44 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 @@ -35,6 +35,7 @@ #include <vespa/vespalib/util/size_literals.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/destructor_callbacks.h> +#include <vespa/vespalib/util/testclock.h> #include <vespa/config/subscription/sourcespec.h> using namespace cloud::config::filedistribution; @@ -215,9 +216,9 @@ struct MySearchableConfig struct MySearchableContext { MyFastAccessContext _fastUpdCtx; - QueryLimiter _queryLimiter; - vespalib::Clock _clock; - SearchableContext _ctx; + QueryLimiter _queryLimiter; + vespalib::TestClock _clock; + SearchableContext _ctx; MySearchableContext(IThreadingService &writeService, std::shared_ptr<bucketdb::BucketDBOwner> bucketDB, IBucketDBHandlerInitializer & bucketDBHandlerInitializer); @@ -236,7 +237,7 @@ MySearchableContext::MySearchableContext(IThreadingService &writeService, IBucketDBHandlerInitializer & bucketDBHandlerInitializer) : _fastUpdCtx(writeService, bucketDB, bucketDBHandlerInitializer), _queryLimiter(), _clock(), - _ctx(_fastUpdCtx._ctx, _queryLimiter, _clock, writeService.shared()) + _ctx(_fastUpdCtx._ctx, _queryLimiter, _clock.clock(), writeService.shared()) {} MySearchableContext::~MySearchableContext() = default; |