Skip to content

Commit 4415678

Browse files
committed
Fix shtest-timeout test harder
Don't produce or expect any output from the infinite looping test - doing so is a recipe for racey flakyness without a longer timeout to ensure the output is received first, even though that doesn't seem integral/important to the test. Instead have a plain, no output infinite loop and check that that is caught and handled. If for some reason the output is valuable for test coverage - the timeout should be increased from 1 second to give the process time to output the text, flush, and for that text to be received and buffered before the test is timed out.
1 parent ba3adfa commit 4415678

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
# RUN: %{python} %s
2-
from __future__ import print_function
3-
4-
import sys
5-
6-
print("Running infinite loop")
7-
sys.stdout.flush() # Make sure the print gets flushed so it appears in lit output.
82
while True:
93
pass

llvm/utils/lit/tests/shtest-timeout.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
# RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s
2626

2727
# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
28-
# CHECK-INTSH-OUT: command output:
2928
# CHECK-INTSH-OUT: command reached timeout: True
3029

3130
# CHECK-INTSH-ERR: Using internal shell

0 commit comments

Comments
 (0)