From: Kefu Chai Date: Sat, 23 Aug 2025 07:39:50 +0000 (+0800) Subject: cmake: disable LeakSanitizer suppression output to fix CLI tests X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F65192%2Fhead;p=ceph.git 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 --- 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})