]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: disable LeakSanitizer suppression output to fix CLI tests
authorKefu Chai <tchaikov@gmail.com>
Sat, 23 Aug 2025 07:39:50 +0000 (15:39 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sat, 23 Aug 2025 07:53:54 +0000 (15:53 +0800)
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 <tchaikov@gmail.com>
cmake/modules/AddCephTest.cmake

index 67e60504d6dd8caacd784be179bef46b2ec4373f..7c40f831f6134e54d525f9a66abc5506c7a42473 100644 (file)
@@ -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})