2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ From 705ba309ccebb0f505107a83542ff13d555008e0 Mon Sep 17 00:00:00 2001
2
+ From: Stephen Huan <stephen.huan@cgdct.moe>
3
+ Date: Mon, 24 Mar 2025 21:35:42 -0400
4
+ Subject: [PATCH] [llvm-exegesis] Timeout if subprocess executor hangs
5
+
6
+ The call to llvm_exegesis_exe nondeterministically hangs, causing
7
+ llvm's tests to block. Introduce a timeout when this happens.
8
+ ---
9
+ llvm/test/tools/llvm-exegesis/lit.local.cfg | 3 ++-
10
+ 1 file changed, 2 insertions(+), 1 deletion(-)
11
+
12
+ diff --git a/llvm/test/tools/llvm-exegesis/lit.local.cfg b/llvm/test/tools/llvm-exegesis/lit.local.cfg
13
+ index a51a2d73442fa..8b7c13f5eb1b6 100644
14
+ --- a/llvm/test/tools/llvm-exegesis/lit.local.cfg
15
+ +++ b/llvm/test/tools/llvm-exegesis/lit.local.cfg
16
+ @@ -24,9 +24,10 @@ def can_use_perf_counters(mode, extra_options=[]):
17
+ + extra_options,
18
+ stdout=subprocess.DEVNULL,
19
+ stderr=subprocess.DEVNULL,
20
+ + timeout=1,
21
+ )
22
+ return return_code == 0
23
+ - except OSError:
24
+ + except (OSError, subprocess.TimeoutExpired):
25
+ print("could not exec llvm-exegesis")
26
+ return False
27
+
Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ stdenv.mkDerivation (finalAttrs: {
94
94
url = "https://github.com/llvm/llvm-project//commit/84837e3cc1cf17ed71580e3ea38299ed2bfaa5f6.patch" ;
95
95
hash = "sha256-QKa+kyXjjGXwTQTEpmKZx5yYjOyBX8A8NQoIYUaGcIw=" ;
96
96
} )
97
+ # fix tests nondeterministically hanging
98
+ # [llvm-exegesis] Timeout if subprocess executor hangs #132861
99
+ # https://github.com/llvm/llvm-project/pull/132861
100
+ ./llvm-exegesis-timeout.patch
97
101
] ;
98
102
99
103
nativeBuildInputs =
0 commit comments