summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/proton/attribute/attributeflush_test.cpp1
-rw-r--r--searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp40
-rw-r--r--searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp8
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp45
-rw-r--r--searchcore/src/tests/proton/flushengine/flushengine_test.cpp6
-rw-r--r--searchcore/src/tests/proton/matching/docid_range_scheduler/docid_range_scheduler_test.cpp3
-rw-r--r--searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp1
-rw-r--r--searchcore/src/tests/proton/metrics/job_tracked_flush/job_tracked_flush_test.cpp24
-rw-r--r--searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp1
10 files changed, 51 insertions, 80 deletions
diff --git a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
index 8a814e25bd5..d6c40b0d70d 100644
--- a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
@@ -18,6 +18,7 @@
#include <vespa/vespalib/util/foreground_thread_executor.h>
#include <vespa/vespalib/util/foregroundtaskexecutor.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
+#include <thread>
#include <vespa/log/log.h>
LOG_SETUP("attributeflush_test");
diff --git a/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp b/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp
index e284f5ed1d9..cb64a1a59d8 100644
--- a/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp
+++ b/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp
@@ -40,7 +40,7 @@ TEST_F("require that attribute write thread is blocked while guard is held", Fix
ReadGuard::UP guard = f.accessor.takeGuard();
Gate gate;
f.writer->execute(f.writer->getExecutorIdFromName(f.attribute->getNamePrefix()), [&gate]() { gate.countDown(); });
- bool reachedZero = gate.await(100);
+ bool reachedZero = gate.await(100ms);
EXPECT_FALSE(reachedZero);
EXPECT_EQUAL(1u, gate.getCount());
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index 1127191a1a2..8840d4778e0 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -78,20 +78,20 @@ struct Rendezvous {
vespalib::Gate gone;
typedef std::unique_ptr<Rendezvous> UP;
Rendezvous() : enter(), leave(), gone() {}
- bool run(uint32_t timeout = 80000) {
+ bool run(vespalib::duration timeout = 80s) {
enter.countDown();
bool retval = leave.await(timeout);
gone.countDown();
return retval;
}
- bool waitForEnter(uint32_t timeout = 80000) {
+ bool waitForEnter(vespalib::duration timeout = 80s) {
return enter.await(timeout);
}
- bool leaveAndWait(uint32_t timeout = 80000) {
+ bool leaveAndWait(vespalib::duration timeout = 80s) {
leave.countDown();
return gone.await(timeout);
}
- bool await(uint32_t timeout = 80000) {
+ bool await(vespalib::duration timeout = 80s) {
if (waitForEnter(timeout)) {
return leaveAndWait(timeout);
}
@@ -373,7 +373,7 @@ struct FeedTokenContext {
FeedTokenContext();
~FeedTokenContext();
- bool await(uint32_t timeout = 80000) { return transport.gate.await(timeout); }
+ bool await(vespalib::duration timeout = 80s) { return transport.gate.await(timeout); }
const Result *getResult() {
if (transport.result.get()) {
return transport.result.get();
@@ -399,36 +399,6 @@ struct PutContext {
{}
};
-
-struct PutHandler {
- FeedHandler &handler;
- DocBuilder &builder;
- Timestamp timestamp;
- std::vector<PutContext::SP> puts;
- PutHandler(FeedHandler &fh, DocBuilder &db) :
- handler(fh),
- builder(db),
- timestamp(0),
- puts()
- {}
- void put(const vespalib::string &docId) {
- PutContext::SP pc(new PutContext(docId, builder));
- FeedOperation::UP op(new PutOperation(pc->docCtx.bucketId, timestamp, pc->docCtx.doc));
- handler.handleOperation(pc->tokenCtx.token, std::move(op));
- timestamp = Timestamp(timestamp + 1);
- puts.push_back(pc);
- }
- bool await(uint32_t timeout = 80000) {
- for (const auto & put : puts) {
- if (!put->tokenCtx.await(timeout)) {
- return false;
- }
- }
- return true;
- }
-};
-
-
struct MyTlsWriter : TlsWriter {
int store_count;
int erase_count;
diff --git a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp
index 2bde5761aea..c12b91c4c1e 100644
--- a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp
@@ -24,7 +24,7 @@ getGateVector(size_t size)
{
GateVector retval;
for (size_t i = 0; i < size; ++i) {
- retval.push_back(GateUP(new Gate()));
+ retval.push_back(std::make_unique<Gate>());
}
return retval;
}
@@ -46,7 +46,7 @@ struct MyMaintenanceJob : public IBlockableMaintenanceJob
void unBlock(BlockedReason) override { _blocked = false; }
bool isBlocked() const override { return _blocked; }
bool run() override {
- _runGates[_runIdx++]->await(5000);
+ _runGates[_runIdx++]->await(5s);
return _runIdx == _runGates.size();
}
};
@@ -82,10 +82,10 @@ struct Fixture
}
void runJobAndWait(size_t runIdx, size_t startedGateCount, size_t endedGateCount) {
_exec.execute(vespalib::makeLambdaTask([this]() { runJob(); }));
- _tracker->_started.await(5000);
+ _tracker->_started.await(5s);
assertTracker(startedGateCount, endedGateCount);
_myJob->_runGates[runIdx]->countDown();
- _runGates[runIdx]->await(5000);
+ _runGates[runIdx]->await(5s);
}
};
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index c6ffa167dbf..44afe1ddd75 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -72,8 +72,7 @@ using BlockedReason = IBlockableMaintenanceJob::BlockedReason;
typedef BucketId::List BucketIdVector;
typedef std::set<BucketId> BucketIdSet;
-constexpr int TIMEOUT_MS = 60000;
-constexpr vespalib::duration TIMEOUT_SEC = 60s;
+constexpr vespalib::duration TIMEOUT = 60s;
namespace {
@@ -947,14 +946,14 @@ TEST_F("require that bucket move controller is active", MaintenanceControllerFix
EXPECT_EQUAL(5u, f._notReady.getNumUsedLids());
EXPECT_EQUAL(5u, f._notReady.getDocumentCount());
f.startMaintenance();
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(0u, f._ready.getNumUsedLids());
EXPECT_EQUAL(0u, f._ready.getDocumentCount());
EXPECT_EQUAL(10u, f._notReady.getNumUsedLids());
EXPECT_EQUAL(10u, f._notReady.getDocumentCount());
f._calc->addReady(bucketId1);
f.notifyClusterStateChanged();
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(3u, f._ready.getNumUsedLids());
EXPECT_EQUAL(3u, f._ready.getDocumentCount());
EXPECT_EQUAL(7u, f._notReady.getNumUsedLids());
@@ -963,13 +962,13 @@ TEST_F("require that bucket move controller is active", MaintenanceControllerFix
f._calc->addReady(bucketId2);
f._calc->addReady(bucketId4);
f.notifyClusterStateChanged();
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(6u, f._ready.getNumUsedLids());
EXPECT_EQUAL(6u, f._ready.getDocumentCount());
EXPECT_EQUAL(4u, f._notReady.getNumUsedLids());
EXPECT_EQUAL(4u, f._notReady.getDocumentCount());
frozen2.reset();
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(8u, f._ready.getNumUsedLids());
EXPECT_EQUAL(8u, f._ready.getDocumentCount());
EXPECT_EQUAL(2u, f._notReady.getNumUsedLids());
@@ -997,14 +996,14 @@ TEST_F("require that document pruner is active", MaintenanceControllerFixture)
EXPECT_EQUAL(10u, f._removed.getNumUsedLids());
EXPECT_EQUAL(10u, f._removed.getDocumentCount());
f.startMaintenance();
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(10u, f._removed.getNumUsedLids());
EXPECT_EQUAL(10u, f._removed.getDocumentCount());
MyFrozenBucket::UP frozen3(new MyFrozenBucket(f._mc, bucketId3));
f.setPruneConfig(DocumentDBPruneRemovedDocumentsConfig(200ms, 900s));
for (uint32_t i = 0; i < 6; ++i) {
std::this_thread::sleep_for(100ms);
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
if (f._removed.getNumUsedLids() != 10u)
break;
}
@@ -1013,7 +1012,7 @@ TEST_F("require that document pruner is active", MaintenanceControllerFixture)
frozen3.reset();
for (uint32_t i = 0; i < 600; ++i) {
std::this_thread::sleep_for(100ms);
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
if (f._removed.getNumUsedLids() != 10u)
break;
}
@@ -1075,7 +1074,7 @@ TEST_F("require that active bucket is not moved until de-activated", Maintenance
EXPECT_EQUAL(5u, f._notReady.getDocumentCount());
f.startMaintenance();
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(5u, f._ready.getNumUsedLids());
EXPECT_EQUAL(5u, f._ready.getDocumentCount());
EXPECT_EQUAL(5u, f._notReady.getNumUsedLids());
@@ -1084,7 +1083,7 @@ TEST_F("require that active bucket is not moved until de-activated", Maintenance
// de-activate bucket 1
f._ready.setBucketState(readyDocs.getBucket(1), false);
f.notifyBucketStateChanged(readyDocs.getBucket(1), BucketInfo::NOT_ACTIVE);
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(2u, f._ready.getNumUsedLids());
EXPECT_EQUAL(2u, f._ready.getDocumentCount());
EXPECT_EQUAL(8u, f._notReady.getNumUsedLids());
@@ -1093,7 +1092,7 @@ TEST_F("require that active bucket is not moved until de-activated", Maintenance
// re-activate bucket 1
f._ready.setBucketState(readyDocs.getBucket(1), true);
f.notifyBucketStateChanged(readyDocs.getBucket(1), BucketInfo::ACTIVE);
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(5u, f._ready.getNumUsedLids());
EXPECT_EQUAL(5u, f._ready.getDocumentCount());
EXPECT_EQUAL(5u, f._notReady.getNumUsedLids());
@@ -1102,7 +1101,7 @@ TEST_F("require that active bucket is not moved until de-activated", Maintenance
// de-activate bucket 1
f._ready.setBucketState(readyDocs.getBucket(1), false);
f.notifyBucketStateChanged(readyDocs.getBucket(1), BucketInfo::NOT_ACTIVE);
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(2u, f._ready.getNumUsedLids());
EXPECT_EQUAL(2u, f._ready.getDocumentCount());
EXPECT_EQUAL(8u, f._notReady.getNumUsedLids());
@@ -1111,7 +1110,7 @@ TEST_F("require that active bucket is not moved until de-activated", Maintenance
// re-activate bucket 1
f._ready.setBucketState(readyDocs.getBucket(1), true);
f.notifyBucketStateChanged(readyDocs.getBucket(1), BucketInfo::ACTIVE);
- ASSERT_TRUE(f._executor.waitIdle(TIMEOUT_SEC));
+ ASSERT_TRUE(f._executor.waitIdle(TIMEOUT));
EXPECT_EQUAL(5u, f._ready.getNumUsedLids());
EXPECT_EQUAL(5u, f._ready.getDocumentCount());
EXPECT_EQUAL(5u, f._notReady.getNumUsedLids());
@@ -1125,19 +1124,19 @@ TEST_F("require that a simple maintenance job is executed", MaintenanceControlle
f._mc.registerJobInMasterThread(std::move(job));
f._injectDefaultJobs = false;
f.startMaintenance();
- bool done = myJob._latch.await(TIMEOUT_MS);
+ bool done = myJob._latch.await(TIMEOUT);
EXPECT_TRUE(done);
EXPECT_EQUAL(0u, myJob._latch.getCount());
}
TEST_F("require that a split maintenance job is executed", MaintenanceControllerFixture)
{
- auto job = std::make_unique<MySplitJob>(200ms, TIMEOUT_SEC * 2, 3);
+ auto job = std::make_unique<MySplitJob>(200ms, TIMEOUT * 2, 3);
MySplitJob &myJob = *job;
f._mc.registerJobInMasterThread(std::move(job));
f._injectDefaultJobs = false;
f.startMaintenance();
- bool done = myJob._latch.await(TIMEOUT_MS);
+ bool done = myJob._latch.await(TIMEOUT);
EXPECT_TRUE(done);
EXPECT_EQUAL(0u, myJob._latch.getCount());
}
@@ -1145,9 +1144,9 @@ TEST_F("require that a split maintenance job is executed", MaintenanceController
TEST_F("require that a blocked job is unblocked and executed after thaw bucket",
MaintenanceControllerFixture)
{
- auto job1 = std::make_unique<MySimpleJob>(TIMEOUT_SEC * 2, TIMEOUT_SEC * 2, 1);
+ auto job1 = std::make_unique<MySimpleJob>(TIMEOUT * 2, TIMEOUT * 2, 1);
MySimpleJob &myJob1 = *job1;
- auto job2 = std::make_unique< MySimpleJob>(TIMEOUT_SEC * 2, TIMEOUT_SEC * 2, 0);
+ auto job2 = std::make_unique< MySimpleJob>(TIMEOUT * 2, TIMEOUT * 2, 0);
MySimpleJob &myJob2 = *job2;
f._mc.registerJobInMasterThread(std::move(job1));
f._mc.registerJobInMasterThread(std::move(job2));
@@ -1169,7 +1168,7 @@ TEST_F("require that a blocked job is unblocked and executed after thaw bucket",
f._executor.sync();
EXPECT_FALSE(myJob1.isBlocked());
EXPECT_FALSE(myJob2.isBlocked());
- bool done1 = myJob1._latch.await(TIMEOUT_MS);
+ bool done1 = myJob1._latch.await(TIMEOUT);
EXPECT_TRUE(done1);
std::this_thread::sleep_for(2s);
EXPECT_EQUAL(0u, myJob2._runCnt);
@@ -1190,14 +1189,14 @@ TEST_F("require that blocked jobs are not executed", MaintenanceControllerFixtur
TEST_F("require that maintenance controller state list jobs", MaintenanceControllerFixture)
{
{
- IMaintenanceJob::UP job1(new MySimpleJob(TIMEOUT_SEC * 2, TIMEOUT_SEC * 2, 0));
- IMaintenanceJob::UP job2(new MyLongRunningJob(200ms, 200ms));
+ auto job1 = std::make_unique<MySimpleJob>(TIMEOUT * 2, TIMEOUT * 2, 0);
+ auto job2 = std::make_unique<MyLongRunningJob>(200ms, 200ms);
auto &longRunningJob = dynamic_cast<MyLongRunningJob &>(*job2);
f._mc.registerJobInMasterThread(std::move(job1));
f._mc.registerJobInMasterThread(std::move(job2));
f._injectDefaultJobs = false;
f.startMaintenance();
- longRunningJob._firstRun.await(TIMEOUT_MS);
+ longRunningJob._firstRun.await(TIMEOUT);
}
MaintenanceControllerExplorer explorer(f._mc.getJobList());
diff --git a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
index fae2e9f2d52..b1c188b2f9f 100644
--- a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
+++ b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
@@ -14,7 +14,7 @@
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <mutex>
-#include <chrono>
+#include <thread>
#include <vespa/log/log.h>
LOG_SETUP("flushengine_test");
@@ -31,8 +31,8 @@ using searchcorespi::IFlushTarget;
using searchcorespi::FlushTask;
using vespalib::Slime;
-constexpr long LONG_TIMEOUT = 66666;
-constexpr long SHORT_TIMEOUT = 1;
+constexpr vespalib::duration LONG_TIMEOUT = 66666ms;
+constexpr vespalib::duration SHORT_TIMEOUT = 1ms;
constexpr vespalib::duration IINTERVAL = 1s;
class SimpleExecutor : public vespalib::Executor {
diff --git a/searchcore/src/tests/proton/matching/docid_range_scheduler/docid_range_scheduler_test.cpp b/searchcore/src/tests/proton/matching/docid_range_scheduler/docid_range_scheduler_test.cpp
index 4814ab4cb49..510269f2195 100644
--- a/searchcore/src/tests/proton/matching/docid_range_scheduler/docid_range_scheduler_test.cpp
+++ b/searchcore/src/tests/proton/matching/docid_range_scheduler/docid_range_scheduler_test.cpp
@@ -1,9 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/time_bomb.h>
#include <vespa/searchcore/proton/matching/docid_range_scheduler.h>
-#include <chrono>
-#include <thread>
using namespace proton::matching;
using vespalib::TimeBomb;
diff --git a/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp b/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp
index c108e98cc2a..1b9c60b379e 100644
--- a/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp
+++ b/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp
@@ -4,6 +4,7 @@
#include <vespa/searchcore/proton/metrics/job_tracked_flush_target.h>
#include <vespa/searchcore/proton/test/dummy_flush_target.h>
#include <vespa/vespalib/testkit/testapp.h>
+#include <thread>
#include <vespa/log/log.h>
LOG_SETUP("documentdb_job_trackers_test");
diff --git a/searchcore/src/tests/proton/metrics/job_tracked_flush/job_tracked_flush_test.cpp b/searchcore/src/tests/proton/metrics/job_tracked_flush/job_tracked_flush_test.cpp
index 7c22aab2285..20d75972c8b 100644
--- a/searchcore/src/tests/proton/metrics/job_tracked_flush/job_tracked_flush_test.cpp
+++ b/searchcore/src/tests/proton/metrics/job_tracked_flush/job_tracked_flush_test.cpp
@@ -27,8 +27,8 @@ struct MyFlushTask : public searchcorespi::FlushTask
MyFlushTask(Gate &execGate) : _execGate(execGate) {}
// Implements searchcorespi::FlushTask
- virtual void run() override {
- _execGate.await(5000);
+ void run() override {
+ _execGate.await(5s);
}
virtual search::SerialNum getFlushSerial() const override { return 5; }
};
@@ -39,7 +39,7 @@ struct MyFlushTarget : public test::DummyFlushTarget
SerialNum _initFlushSerial;
Gate _execGate;
Gate _initGate;
- MyFlushTarget()
+ MyFlushTarget() noexcept
: test::DummyFlushTarget("mytarget", Type::FLUSH, Component::OTHER),
_initFlushSerial(0),
_execGate(),
@@ -50,8 +50,8 @@ struct MyFlushTarget : public test::DummyFlushTarget
FlushTask::UP initFlush(SerialNum currentSerial, std::shared_ptr<search::IFlushToken>) override {
if (currentSerial > 0) {
_initFlushSerial = currentSerial;
- _initGate.await(5000);
- return FlushTask::UP(new MyFlushTask(_execGate));
+ _initGate.await(5s);
+ return std::make_unique<MyFlushTask>(_execGate);
}
return FlushTask::UP();
}
@@ -66,8 +66,8 @@ struct Fixture
Gate _taskGate;
ThreadStackExecutor _exec;
Fixture(uint32_t numJobTrackings = 1)
- : _tracker(new SimpleJobTracker(numJobTrackings)),
- _target(new MyFlushTarget()),
+ : _tracker(std::make_shared<SimpleJobTracker>(numJobTrackings)),
+ _target(std::make_shared<MyFlushTarget>()),
_trackedFlush(_tracker, _target),
_task(),
_taskGate(),
@@ -95,12 +95,12 @@ TEST_F("require that flush task init is tracked", Fixture)
EXPECT_EQUAL(1u, f._tracker->_ended.getCount());
f._exec.execute(makeLambdaTask([&]() {f.initFlush(FLUSH_SERIAL); }));
- f._tracker->_started.await(5000);
+ f._tracker->_started.await(5s);
EXPECT_EQUAL(0u, f._tracker->_started.getCount());
EXPECT_EQUAL(1u, f._tracker->_ended.getCount());
f._target->_initGate.countDown();
- f._taskGate.await(5000);
+ f._taskGate.await(5s);
EXPECT_EQUAL(0u, f._tracker->_ended.getCount());
{
JobTrackedFlushTask *trackedTask = dynamic_cast<JobTrackedFlushTask *>(f._task.get());
@@ -114,18 +114,18 @@ TEST_F("require that flush task execution is tracked", Fixture(2))
{
f._exec.execute(makeLambdaTask([&]() { f.initFlush(FLUSH_SERIAL); }));
f._target->_initGate.countDown();
- f._taskGate.await(5000);
+ f._taskGate.await(5s);
EXPECT_EQUAL(1u, f._tracker->_started.getCount());
EXPECT_EQUAL(1u, f._tracker->_ended.getCount());
f._exec.execute(std::move(f._task));
- f._tracker->_started.await(5000);
+ f._tracker->_started.await(5s);
EXPECT_EQUAL(0u, f._tracker->_started.getCount());
EXPECT_EQUAL(1u, f._tracker->_ended.getCount());
f._target->_execGate.countDown();
- f._tracker->_ended.await(5000);
+ f._tracker->_ended.await(5s);
EXPECT_EQUAL(0u, f._tracker->_ended.getCount());
}
diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp
index f028de23be6..63c861a60d9 100644
--- a/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp
+++ b/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp
@@ -7,6 +7,7 @@
#include <vespa/searchcore/proton/reference/gid_to_lid_change_listener.h>
#include <vespa/searchlib/common/i_gid_to_lid_mapper_factory.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
+#include <vespa/vespalib/util/gate.h>
#include <vespa/searchlib/test/mock_gid_to_lid_mapping.h>
#include <map>
#include <vespa/log/log.h>