Guard sentinel/cluster err.txt valgrind scan with $::valgrind#3982
Conversation
Signed-off-by: Smail Kourta <smail.kourta@canonical.com>
2ee614e to
0b03e0d
Compare
📝 WalkthroughWalkthroughThe PR adds a conditional guard to the ChangesValgrind error scan conditional guard
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3982 +/- ##
============================================
+ Coverage 76.54% 76.70% +0.15%
============================================
Files 162 162
Lines 80775 80777 +2
============================================
+ Hits 61833 61962 +129
+ Misses 18942 18815 -127 🚀 New features to boost your workflow:
|
Issue Description
log_crashesintests/instances.tcl— the multi-instance harness used by bothmake test-sentinelandmake test-cluster— scans every instance'serr.txtwithfind_valgrind_errorsunconditionally:The main test framework runs the identical scan only behind a valgrind guard — in
tests/support/server.tcl,check_valgrind_errorsis called fromkill_serverinsideif {$::valgrind}.find_valgrind_errors' fallback (intests/support/util.tcl) treats any stderr that lacks a valgrind leak-free summary as an error:When the suite is not running under valgrind, that summary is never present, so any non-empty
err.txtis flagged as a failure.Concrete trigger
On hosts whose CPU does not expose the
constant_tscflag (common inside VMs / LXD), everyvalkey-serverandvalkey-sentinelprints to stderr at startup (src/monotonic.c):The sentinel suite then reports exactly 10 failures (5 sentinel + 5 valkey instances) on every run — even though every individual test passes and no assertion fails. The cluster suite shares this harness and is affected identically. On hosts that expose
constant_tscthe message is never printed, so the bug is invisible — which is why it only surfaces in certain CI/VM environments.Fix
Wrap the valgrind
err.txtscan inif {$::valgrind}, mirroringserver.tcl. The sanitizer scan immediately below is left unguarded, matchingcheck_sanitizer_errors, which always runs. No test coverage is lost.