[llvm-branch-commits] [llvm] 4415678 - Fix shtest-timeout test harder

David Blaikie via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 8 00:28:18 PST 2020


Author: David Blaikie
Date: 2020-12-08T00:23:33-08:00
New Revision: 4415678718ad471c84f024e20ce864ae1e79348a

URL: https://github.com/llvm/llvm-project/commit/4415678718ad471c84f024e20ce864ae1e79348a
DIFF: https://github.com/llvm/llvm-project/commit/4415678718ad471c84f024e20ce864ae1e79348a.diff

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

Added: 
    

Modified: 
    llvm/utils/lit/tests/Inputs/shtest-timeout/infinite_loop.py
    llvm/utils/lit/tests/shtest-timeout.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/tests/Inputs/shtest-timeout/infinite_loop.py b/llvm/utils/lit/tests/Inputs/shtest-timeout/infinite_loop.py
index c8ced24f29c5..079f3595e175 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-timeout/infinite_loop.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-timeout/infinite_loop.py
@@ -1,9 +1,3 @@
 # RUN: %{python} %s
-from __future__ import print_function
-
-import sys
-
-print("Running infinite loop")
-sys.stdout.flush() # Make sure the print gets flushed so it appears in lit output.
 while True:
     pass

diff  --git a/llvm/utils/lit/tests/shtest-timeout.py b/llvm/utils/lit/tests/shtest-timeout.py
index f229c286088b..1576b89ea182 100644
--- a/llvm/utils/lit/tests/shtest-timeout.py
+++ b/llvm/utils/lit/tests/shtest-timeout.py
@@ -25,7 +25,6 @@
 # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s
 
 # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
-# CHECK-INTSH-OUT: command output:
 # CHECK-INTSH-OUT: command reached timeout: True
 
 # CHECK-INTSH-ERR: Using internal shell


        


More information about the llvm-branch-commits mailing list