diff --git a/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py --- a/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py +++ b/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py @@ -9,7 +9,6 @@ if sys.argv[1] == "--gtest_list_tests": print("""\ FirstTest. - subTestA subTestB subTestC """) @@ -18,15 +17,10 @@ raise ValueError("unexpected argument: %r" % (sys.argv[1])) test_name = sys.argv[1].split('=',1)[1] -if test_name == 'FirstTest.subTestA': - print('I am subTest A, I PASS') - print('[ PASSED ] 1 test.') - sys.exit(0) -elif test_name == 'FirstTest.subTestB': - print('I am subTest B, I am slow') - time.sleep(6) - print('[ PASSED ] 1 test.') - sys.exit(0) +if test_name == 'FirstTest.subTestB': + print('I am subTest B, I will hang') + while True: + pass elif test_name == 'FirstTest.subTestC': print('I am subTest C, I will hang') while True: diff --git a/llvm/utils/lit/tests/Inputs/shtest-timeout/short.py b/llvm/utils/lit/tests/Inputs/shtest-timeout/short.py deleted file mode 100644 --- a/llvm/utils/lit/tests/Inputs/shtest-timeout/short.py +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: %{python} %s -from __future__ import print_function - -print("short program") diff --git a/llvm/utils/lit/tests/googletest-timeout.py b/llvm/utils/lit/tests/googletest-timeout.py --- a/llvm/utils/lit/tests/googletest-timeout.py +++ b/llvm/utils/lit/tests/googletest-timeout.py @@ -13,10 +13,8 @@ # RUN: FileCheck < %t.cfgset.out %s # CHECK: -- Testing: -# CHECK: PASS: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestA # CHECK: TIMEOUT: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestB # CHECK: TIMEOUT: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestC -# CHECK: Passed : 1 # CHECK: Timed Out: 2 # Test per test timeout via a config file and on the command line. diff --git a/llvm/utils/lit/tests/shtest-timeout.py b/llvm/utils/lit/tests/shtest-timeout.py --- a/llvm/utils/lit/tests/shtest-timeout.py +++ b/llvm/utils/lit/tests/shtest-timeout.py @@ -3,16 +3,10 @@ # llvm.org/PR33944 # UNSUPPORTED: system-windows -# FIXME: This test is fragile because it relies on time which can -# be affected by system performance. In particular we are currently -# assuming that `short.py` can be successfully executed within 2 -# seconds of wallclock time. - # Test per test timeout using external shell # RUN: not %{lit} \ # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ -# RUN: %{inputs}/shtest-timeout/short.py \ -# RUN: -j 1 -v --debug --timeout 2 --param external=1 > %t.extsh.out 2> %t.extsh.err +# RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s # @@ -21,8 +15,7 @@ # Test per test timeout using internal shell # RUN: not %{lit} \ # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ -# RUN: %{inputs}/shtest-timeout/short.py \ -# RUN: -j 1 -v --debug --timeout 2 --param external=0 > %t.intsh.out 2> %t.intsh.err +# RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s # RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s @@ -36,40 +29,32 @@ # Test per test timeout set via a config file rather than on the command line # RUN: not %{lit} \ # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ -# RUN: %{inputs}/shtest-timeout/short.py \ # RUN: -j 1 -v --debug --param external=0 \ -# RUN: --param set_timeout=2 > %t.cfgset.out 2> %t.cfgset.err +# RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s # RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s # # CHECK-CFGSET-ERR: Using internal shell # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py -# CHECK-OUT-COMMON: Timeout: Reached timeout of 2 seconds +# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output -# CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py - -# CHECK-OUT-COMMON: Passed : 1 # CHECK-OUT-COMMON: Timed Out: 1 # Test per test timeout via a config file and on the command line. # The value set on the command line should override the config file. # RUN: not %{lit} \ # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ -# RUN: %{inputs}/shtest-timeout/short.py \ # RUN: -j 1 -v --debug --param external=0 \ -# RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err +# RUN: --param set_timeout=3 --timeout=1 > %t.cmdover.out 2> %t.cmdover.err # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s -# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds +# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 1 seconds # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py -# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds +# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 1 seconds # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output -# CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py - -# CHECK-CMDLINE-OVERRIDE-OUT: Passed : 1 # CHECK-CMDLINE-OVERRIDE-OUT: Timed Out: 1