diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-02 15:16:42 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-02 15:16:42 +0000 |
commit | ccefa102abea7840b16767f7f13753cfac71b873 (patch) | |
tree | 6ba670449a885f175a501c2e19fc2f17ba6a5ece | |
parent | 29e685dfce2ff708f7d2cb03d43fa3775d25efd9 (diff) |
Use foreground executor.
-rw-r--r-- | searchcore/src/tests/proton/server/feedstates_test.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/searchcore/src/tests/proton/server/feedstates_test.cpp b/searchcore/src/tests/proton/server/feedstates_test.cpp index 15083975824..42d88328d14 100644 --- a/searchcore/src/tests/proton/server/feedstates_test.cpp +++ b/searchcore/src/tests/proton/server/feedstates_test.cpp @@ -12,6 +12,7 @@ #include <vespa/searchcore/proton/test/dummy_feed_view.h> #include <vespa/searchlib/common/serialnum.h> #include <vespa/vespalib/objects/nbostream.h> +#include <vespa/vespalib/util/foreground_thread_executor.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/buffer.h> #include <vespa/searchcore/proton/bucketdb/bucketdbhandler.h> @@ -28,6 +29,7 @@ using search::SerialNum; using storage::spi::Timestamp; using vespalib::ConstBufferRef; using vespalib::nbostream; +using vespalib::ForegroundThreadExecutor; using namespace proton; namespace { @@ -51,13 +53,6 @@ struct MyReplayConfig : IReplayConfig { void replayConfig(SerialNum) override {} }; -struct InstantExecutor : vespalib::Executor { - Task::UP execute(Task::UP task) override { - task->run(); - return Task::UP(); - } -}; - struct Fixture { MyFeedView feed_view1; @@ -112,7 +107,7 @@ TEST_F("require that active FeedView can change during replay", Fixture) { RemoveOperationContext opCtx(10); auto wrap = std::make_shared<PacketWrapper>(*opCtx.packet, nullptr); - InstantExecutor executor; + ForegroundThreadExecutor executor; EXPECT_EQUAL(0, f.feed_view1.remove_handled); EXPECT_EQUAL(0, f.feed_view2.remove_handled); @@ -130,7 +125,7 @@ TEST_F("require that replay progress is tracked", Fixture) RemoveOperationContext opCtx(10); TlsReplayProgress progress("test", 5, 15); PacketWrapper::SP wrap(new PacketWrapper(*opCtx.packet, &progress)); - InstantExecutor executor; + ForegroundThreadExecutor executor; f.state.receive(wrap, executor); EXPECT_EQUAL(10u, progress.getCurrent()); |