[compiler-rt] 191dbca - [ASan][test-only] Allow Darwin test duplicate_os_log_reports to retry (#158662)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 23 01:44:31 PDT 2025


Author: Dan Blackwell
Date: 2025-09-23T09:44:27+01:00
New Revision: 191dbcaf4d49a7cd25c8f9b80bd1b8c427673e0b

URL: https://github.com/llvm/llvm-project/commit/191dbcaf4d49a7cd25c8f9b80bd1b8c427673e0b
DIFF: https://github.com/llvm/llvm-project/commit/191dbcaf4d49a7cd25c8f9b80bd1b8c427673e0b.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp b/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp
index 0091ebc09205c..5a0353bfb1b31 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp
+++ b/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp
@@ -8,8 +8,13 @@
 // RUN: FileCheck %s --check-prefixes CHECK,CHECK-PROC -input-file=%t.process_output.txt
 
 // Check syslog output. We filter recent system logs based on PID to avoid
-// getting the logs of previous test runs.
-// RUN: log show --debug --last 5m  --predicate "processID == ${TEST_PID}" --style syslog > %t.process_syslog_output.txt
+// getting the logs of previous test runs. Make some reattempts in case there
+// is a delay.
+// RUN: for I in {1..3}; do \
+// RUN:   log show --debug --last $((SECONDS + 30))s --predicate "processID == ${TEST_PID}" --style syslog > %t.process_syslog_output.txt; \
+// RUN:   if grep -q "use-after-poison" %t.process_syslog_output.txt; then break; fi; \
+// RUN:   sleep 5; \
+// RUN: done
 // RUN: FileCheck %s -input-file=%t.process_syslog_output.txt
 #include <cassert>
 #include <cstdio>


        


More information about the llvm-commits mailing list