From 65bede20808a55f7e8d85147f3e2866492cfbef3 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 23 Aug 2025 15:39:50 +0800 Subject: [PATCH] cmake: disable LeakSanitizer suppression output to fix CLI tests LeakSanitizer prints matched suppressions by default, which causes CLI tests to fail when built with LSan enabled. The tests compare actual output against expected output, and the additional LSan messages break this comparison. Example failure: ``` /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t: failed --- /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t +++ /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t.err @@ -21,3 +21,9 @@ stats histogram [prefix] + ----------------------------------------------------- + Suppressions used: + count bytes template + 1 45 ^MallocExtension::Initialize + ----------------------------------------------------- + ``` Set LSAN_OPTIONS=print_suppressions=0 to prevent this output rather than modifying test expectations, since the suppression messages are not part of the actual tool output and would vary between builds. This change should fix run_cli_tests failures when building with LeakSanitizer See https://github.com/google/sanitizers/wiki/SanitizerCommonFlags for the environment variables respected by LeakSanitizer. Signed-off-by: Kefu Chai --- cmake/modules/AddCephTest.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/AddCephTest.cmake b/cmake/modules/AddCephTest.cmake index 67e60504d6dd..7c40f831f613 100644 --- a/cmake/modules/AddCephTest.cmake +++ b/cmake/modules/AddCephTest.cmake @@ -33,7 +33,7 @@ function(add_ceph_test test_name test_path) APPEND PROPERTY ENVIRONMENT ASAN_OPTIONS=detect_odr_violation=0 - LSAN_OPTIONS=suppressions=${CMAKE_SOURCE_DIR}/qa/lsan.supp) + LSAN_OPTIONS=suppressions=${CMAKE_SOURCE_DIR}/qa/lsan.supp,print_suppressions=0) endif() set_property(TEST ${test_name} PROPERTY TIMEOUT ${CEPH_TEST_TIMEOUT}) -- 2.47.3