From: Kefu Chai Date: Tue, 27 Jan 2026 08:34:09 +0000 (+0800) Subject: test/ceph_assert: fix death test timeout with threadsafe style X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F67085%2Fhead;p=ceph.git test/ceph_assert: fix death test timeout with threadsafe style The unittest_ceph_assert test was timing out intermittently with warning: ``` "Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 3 threads." ``` The issue occurs because global_init() creates threads before the death tests run. Use the "threadsafe" death test style to handle this safely, matching the pattern already used in ceph_breakpad.cc and test_perf_counters_cache.cc. see also https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads Signed-off-by: Kefu Chai --- diff --git a/src/test/ceph_assert.cc b/src/test/ceph_assert.cc index ffda50123086..4fc606d7b119 100644 --- a/src/test/ceph_assert.cc +++ b/src/test/ceph_assert.cc @@ -52,5 +52,6 @@ int main(int argc, char **argv) { "{}:{}, {}:{}", __FILE__, /* LINE21 */21, __FILE__, /* LINE24 */24)); common_init_finish(g_ceph_context); testing::InitGoogleTest(&argc, argv); + GTEST_FLAG_SET(death_test_style, "threadsafe"); return RUN_ALL_TESTS(); }