From: Lucian Petrut Date: Tue, 5 May 2020 09:04:44 +0000 (+0000) Subject: test: Initialize timer X-Git-Tag: v16.1.0~69^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b65968028ab34201da9aca976377c345c02432c1;p=ceph.git 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 --- diff --git a/src/test/TestTimers.cc b/src/test/TestTimers.cc index 0d83c6fcdd03..eaa78f82b6ba 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; }