Commit 1b5ac46
committed
feat(runner): add per-test timeout via --timeout flag
Tests that hang indefinitely (e.g. GPU ops stuck on Blackwell) block the
entire suite. Add a --timeout SECONDS option to tests/runner.py that uses
SIGALRM to interrupt any individual test that exceeds the limit; the test is
recorded as an error and the runner continues with the next test.
- Default is 0 (disabled); SIGALRM support is checked at runtime so the flag
is silently ignored on Windows.
- runtests.sh gains a matching --timeout [secs] flag (default 180s when the
flag is given without a value) that is forwarded to runner.py for unit tests.
Usage:
./runtests.sh -u --timeout # 3-minute per-test limit
./runtests.sh -u --timeout 60 # 1-minute per-test limit
python tests/runner.py --timeout 180
https://claude.ai/code/session_015SGxtVTnVKUHk7hWHLSRZK1 parent 2b5b367 commit 1b5ac46
2 files changed
+50
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
| |||
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
347 | 359 | | |
348 | 360 | | |
349 | 361 | | |
| |||
695 | 707 | | |
696 | 708 | | |
697 | 709 | | |
698 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
699 | 715 | | |
700 | 716 | | |
701 | 717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
| |||
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
| 61 | + | |
| 62 | + | |
44 | 63 | | |
45 | 64 | | |
46 | 65 | | |
| |||
99 | 118 | | |
100 | 119 | | |
101 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
102 | 128 | | |
103 | 129 | | |
104 | 130 | | |
| |||
145 | 171 | | |
146 | 172 | | |
147 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
148 | 181 | | |
149 | 182 | | |
150 | 183 | | |
| |||
0 commit comments