From 357a56bb1869599c7e4430cd2c5d9ab98e8e6309 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 27 Jan 2026 16:34:09 +0800 Subject: [PATCH] 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 --- src/test/ceph_assert.cc | 1 + 1 file changed, 1 insertion(+) 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(); } -- 2.47.3