[compiler-rt] [NFC][asan] Try to deflake asan_lsan_deadlock test (PR #137718)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 28 14:50:20 PDT 2025
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/137718
10s looks not enough. With highly parallel test
execution on VMs it's very possible that Asan
report will have no enough time to produce output.
I can reproduce locally 1s is not always enough,
but likely my workstation is faster then buildbot.
Additionally, don't use puts/CHECK to validate
timeout. We can exit with 0 and it should violate
"not" expectation.
>From cfa4a1af18dc9b64eb82a72c58fb6498dcd5e008 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Mon, 28 Apr 2025 14:50:06 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
=?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
---
compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp b/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp
index 7ca07edbaf18c..7c2dbf27da3d4 100644
--- a/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp
+++ b/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp
@@ -36,11 +36,8 @@
void Watchdog() {
// Safety mechanism: Turn infinite deadlock into finite test failure
- usleep(10000000);
- // CHECK-NOT: Timeout! Deadlock detected.
- puts("Timeout! Deadlock detected.");
- fflush(stdout);
- _exit(1);
+ sleep(60);
+ _exit(0);
}
int main(int argc, char **argv) {
More information about the llvm-commits
mailing list