summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-02 17:27:57 +0200
committerGitHub <noreply@github.com>2020-10-02 17:27:57 +0200
commitafc1dcab84c69ca278ea1868dd6707bec2d166bb (patch)
treec608f778283044afd6e2d0c95e24305a4509d0d3
parent0de9ce4691e03e5363747f3c3c2955fce24ee1e2 (diff)
parentccefa102abea7840b16767f7f13753cfac71b873 (diff)
Merge pull request #14688 from vespa-engine/balder/use-forground-executor
Use foreground executor.
-rw-r--r--searchcore/src/tests/proton/server/feedstates_test.cpp13
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());