]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/common: unittest_fault_injector omits unit-main target 63979/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 9 Jun 2025 13:10:40 +0000 (09:10 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 17 Jun 2025 12:01:30 +0000 (08:01 -0400)
unittest_fault_injector includes death tests for InjectAbort coverage,
and death tests don't play nicely with threads. the unit-main target
provides a main() function that initializes a g_ceph_context and starts
its associated threads. omit unit-main to prevent the log thread from
starting

Fixes: https://tracker.ceph.com/issues/71600
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit bac78660c0338b33d092ab571f9347e6605aa0c4)

src/test/common/CMakeLists.txt

index a9b5d4ff8b99261cbd9bcdae51fdf0f5a1e73a52..5386711a7b8eecb46060c9fe72f10ae52f620601 100644 (file)
@@ -369,9 +369,8 @@ add_executable(unittest_option test_option.cc)
 target_link_libraries(unittest_option ceph-common GTest::Main)
 add_ceph_unittest(unittest_option)
 
-add_executable(unittest_fault_injector test_fault_injector.cc
-  $<TARGET_OBJECTS:unit-main>)
-target_link_libraries(unittest_fault_injector global)
+add_executable(unittest_fault_injector test_fault_injector.cc)
+target_link_libraries(unittest_fault_injector global GTest::Main)
 add_ceph_unittest(unittest_fault_injector)
 
 add_executable(unittest_blocked_completion test_blocked_completion.cc)