Skip to content

Commit 191dbca

Browse files
authored
[ASan][test-only] Allow Darwin test duplicate_os_log_reports to retry (#158662)
Currently this test is flaky. I believe that it may be because the logs have not flushed to disk before the `log show` command is run. This patch allows the test to retry reading the log twice more with a 5 second sleep inbetween.
1 parent d65c7ac commit 191dbca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
// RUN: FileCheck %s --check-prefixes CHECK,CHECK-PROC -input-file=%t.process_output.txt
99

1010
// Check syslog output. We filter recent system logs based on PID to avoid
11-
// getting the logs of previous test runs.
12-
// RUN: log show --debug --last 5m --predicate "processID == ${TEST_PID}" --style syslog > %t.process_syslog_output.txt
11+
// getting the logs of previous test runs. Make some reattempts in case there
12+
// is a delay.
13+
// RUN: for I in {1..3}; do \
14+
// RUN: log show --debug --last $((SECONDS + 30))s --predicate "processID == ${TEST_PID}" --style syslog > %t.process_syslog_output.txt; \
15+
// RUN: if grep -q "use-after-poison" %t.process_syslog_output.txt; then break; fi; \
16+
// RUN: sleep 5; \
17+
// RUN: done
1318
// RUN: FileCheck %s -input-file=%t.process_syslog_output.txt
1419
#include <cassert>
1520
#include <cstdio>

0 commit comments

Comments
 (0)