diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-15 10:53:04 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-15 10:53:04 +0000 |
commit | 6aa599ad8c189a3a78b7c7f3ac7962ac043c0108 (patch) | |
tree | a98615dbcd91566f6ec6368064c55018d1b8c15d /searchcore | |
parent | d353b99f58fa5aef9da820f0a561748d2578a9f3 (diff) |
Use a timeBomb to ensure test terminates on error.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/tests/proton/common/timer/timer_test.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/common/timer/timer_test.cpp b/searchcore/src/tests/proton/common/timer/timer_test.cpp index 63b4a1a6bf3..56bad3981c9 100644 --- a/searchcore/src/tests/proton/common/timer/timer_test.cpp +++ b/searchcore/src/tests/proton/common/timer/timer_test.cpp @@ -7,6 +7,7 @@ #include <vespa/vespalib/util/count_down_latch.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/lambdatask.h> +#include <vespa/vespalib/testkit/time_bomb.h> #include <thread> using vespalib::Executor; @@ -83,6 +84,7 @@ TYPED_TEST(ScheduledExecutorTest, test_drop_handle) { } TYPED_TEST(ScheduledExecutorTest, test_only_one_instance_running) { + vespalib::TimeBomb time_bomb(60s); vespalib::Gate latch; std::atomic<uint64_t> counter = 0; auto handleA = this->timer->scheduleAtFixedRate(makeLambdaTask([&]() { counter++; latch.await();}), 0ms, 1ms); @@ -94,6 +96,7 @@ TYPED_TEST(ScheduledExecutorTest, test_only_one_instance_running) { } TYPED_TEST(ScheduledExecutorTest, test_sync_delete) { + vespalib::TimeBomb time_bomb(60s); vespalib::Gate latch; std::atomic<uint64_t> counter = 0; std::atomic<uint64_t> reset_counter = 0; |