From: Sage Weil Date: Tue, 21 Jan 2020 21:17:19 +0000 (-0600) Subject: unittest_lockdep: avoid any threads for death test X-Git-Tag: v15.1.0~121^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32765%2Fhead;p=ceph.git unittest_lockdep: avoid any threads for death test Heed the warning: [WARNING] /home/sage/src/ceph/src/googletest/googletest/src/gtest-death-test.cc:1122:: Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 4 threads. See https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests-and-threads for more explanation and suggested solutions, especially if this is the last message you see before your test times out. Fixes: https://tracker.ceph.com/issues/43403 Signed-off-by: Sage Weil --- diff --git a/src/test/common/test_lockdep.cc b/src/test/common/test_lockdep.cc index 993fa4423c2..0198f50d507 100644 --- a/src/test/common/test_lockdep.cc +++ b/src/test/common/test_lockdep.cc @@ -9,6 +9,7 @@ #include "global/global_init.h" #include "common/lockdep.h" #include "include/coredumpctl.h" +#include "log/Log.h" TEST(lockdep, abba) { @@ -65,9 +66,13 @@ int main(int argc, char **argv) { auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, - CINIT_FLAG_NO_MON_CONFIG); + CINIT_FLAG_NO_MON_CONFIG | + CINIT_FLAG_NO_DAEMON_ACTIONS); common_init_finish(g_ceph_context); + // stop logging thread + g_ceph_context->_log->stop(); + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }