]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_lockdep: avoid any threads for death test 32765/head
authorSage Weil <sage@redhat.com>
Tue, 21 Jan 2020 21:17:19 +0000 (15:17 -0600)
committerSage Weil <sage@redhat.com>
Tue, 21 Jan 2020 21:17:19 +0000 (15:17 -0600)
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 <sage@redhat.com>
src/test/common/test_lockdep.cc

index 993fa4423c24f439035d347a46e44862f2253286..0198f50d50743de194d90e0e204c254d8690684b 100644 (file)
@@ -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();
 }