From b65968028ab34201da9aca976377c345c02432c1 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Tue, 5 May 2020 09:04:44 +0000 Subject: [PATCH] test: Initialize timer Some timer tests don't actually initialize the timer, for which reason the callbacks will never be executed, leading to an infinite loop. This change initializes the timer, stopping it after the tests finish. Signed-off-by: Lucian Petrut --- src/test/TestTimers.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/TestTimers.cc b/src/test/TestTimers.cc index 0d83c6fcdd0..eaa78f82b6b 100644 --- a/src/test/TestTimers.cc +++ b/src/test/TestTimers.cc @@ -255,6 +255,7 @@ int main(int argc, const char **argv) int ret; ceph::mutex safe_timer_lock = ceph::make_mutex("safe_timer_lock"); SafeTimer safe_timer(g_ceph_context, safe_timer_lock); + safe_timer.init(); ret = basic_timer_test (safe_timer, &safe_timer_lock); if (ret) @@ -273,6 +274,7 @@ int main(int argc, const char **argv) goto done; done: + safe_timer.shutdown(); print_status(argv[0], ret); return ret; } -- 2.39.5