summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2024-06-30 08:42:06 +0200
committerJunio C Hamano <gitster@pobox.com>2024-07-02 00:09:07 +0200
commit47c6d4dad22a751068a4975f1c4177cc6c0c41d2 (patch)
treed35d986e50447466556a5b98bfd2d9cc0de45351 /ci
parentMore post 2.45.2 updates from the 'master' front (diff)
downloadgit-47c6d4dad22a751068a4975f1c4177cc6c0c41d2.tar.xz
git-47c6d4dad22a751068a4975f1c4177cc6c0c41d2.zip
test-lib: fix GIT_TEST_SANITIZE_LEAK_LOG
When a test that leaks runs with GIT_TEST_SANITIZE_LEAK_LOG=true, the test returns zero, which is not what we want. In the if-else's chain we have in "check_test_results_san_file_", we consider three variables: $passes_sanitize_leak, $sanitize_leak_check and, implicitly, GIT_TEST_SANITIZE_LEAK_LOG (always set to "true" at that point). For the first two variables we have different considerations depending on the value of $test_failure, which makes sense. However, for the third, GIT_TEST_SANITIZE_LEAK_LOG, we don't; regardless of $test_failure, we use "invert_exit_code=t" to produce a non-zero return value. That assumes "$test_failure" is always zero at that point. But it may not be: $ git checkout v2.40.1 $ make test SANITIZE=leak T=t3200-branch.sh # this fails $ make test SANITIZE=leak GIT_TEST_SANITIZE_LEAK_LOG=true T=t3200-branch.sh # this succeeds [...] With GIT_TEST_SANITIZE_LEAK_LOG=true, our logs revealed a memory leak, exiting with a non-zero status! # faked up failures as TODO & now exiting with 0 due to --invert-exit-code We need to use "invert_exit_code=t" only when "$test_failure" is zero. Let's add the missing conditions in the if-else's chain to make it work as expected. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Rubén Justo <rjusto@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ci')
0 files changed, 0 insertions, 0 deletions