Skip to content

Commit 6fb8cb3

Browse files
peffgitster
authored andcommitted
test-lib: check leak logs for presence of DEDUP_TOKEN
When we check the leak logs, our original strategy was to check for any non-empty log file produced by LSan. We later amended that to ignore noisy lines in 370ef7e (test-lib: ignore uninteresting LSan output, 2023-08-28). This makes it hard to ignore noise which is more than a single line; we'd have to actually parse the file to determine the meaning of each line. But there's an easy line-oriented solution. Because we always pass the dedup_token_length option, the output will contain a DEDUP_TOKEN line for each leak that has been found. So if we invert our strategy to stop ignoring useless lines and only look for useful ones, we can just count the number of DEDUP_TOKEN lines. If it's non-zero, then we found at least one leak (it would even give us a count of unique leaks, but we really only care if it is non-zero). This should yield the same outcome, but will help us build more false positive detection on top. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 373a432 commit 6fb8cb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: t/test-lib.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ check_test_results_san_file_empty_ () {
11771177
! find "$TEST_RESULTS_SAN_DIR" \
11781178
-type f \
11791179
-name "$TEST_RESULTS_SAN_FILE_PFX.*" 2>/dev/null |
1180-
xargs grep -qv "Unable to get registers from thread"
1180+
xargs grep -q ^DEDUP_TOKEN
11811181
}
11821182

11831183
check_test_results_san_file_ () {

0 commit comments

Comments
 (0)