llvm.org GIT mirror llvm / 9f0686b
[lit] Try to make `shtest-timeout.py` test more reliable by using a larger timeout value. This really isn't very good because it will still be susceptible to machine performance. While we are here also fix a bug in validation of `maxIndividualTestTime` where previously it wasn't checked if the type was an int. rdar://problem/40221572 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332987 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Liew 1 year, 4 months ago
3 changed file(s) with 13 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
8282 Interface for setting maximum time to spend executing
8383 a single test
8484 """
85 if not isinstance(value, int):
86 self.fatal('maxIndividualTestTime must set to a value of type int.')
8587 self._maxIndividualTestTime = value
8688 if self.maxIndividualTestTime > 0:
8789 # The current implementation needs psutil to set
1616
1717 configSetTimeout = lit_config.params.get('set_timeout', '0')
1818
19 if configSetTimeout == '1':
19 if configSetTimeout != '0':
2020 # Try setting the max individual test time in the configuration
21 lit_config.maxIndividualTestTime = 1
21 lit_config.maxIndividualTestTime = int(configSetTimeout)
2222
2323 config.test_format = lit.formats.ShTest(execute_external=externalShell)
2424 config.suffixes = ['.py']
22 # PR33944
33 # XFAIL: windows
44
5 # FIXME: This test is fragile because it relies on time which can
6 # be affected by system performance. In particular we are currently
7 # assuming that `short.py` can be successfully executed within 2
8 # seconds of wallclock time.
9
510 # Test per test timeout using external shell
611 # RUN: not %{lit} \
712 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
813 # RUN: %{inputs}/shtest-timeout/short.py \
9 # RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err
14 # RUN: -j 1 -v --debug --timeout 2 --param external=1 > %t.extsh.out 2> %t.extsh.err
1015 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s
1116 # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s
1217 #
1621 # RUN: not %{lit} \
1722 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
1823 # RUN: %{inputs}/shtest-timeout/short.py \
19 # RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err
24 # RUN: -j 1 -v --debug --timeout 2 --param external=0 > %t.intsh.out 2> %t.intsh.err
2025 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s
2126 # RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s
2227 # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s
3237 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
3338 # RUN: %{inputs}/shtest-timeout/short.py \
3439 # RUN: -j 1 -v --debug --param external=0 \
35 # RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err
40 # RUN: --param set_timeout=2 > %t.cfgset.out 2> %t.cfgset.err
3641 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s
3742 # RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s
3843 #
3944 # CHECK-CFGSET-ERR: Using internal shell
4045
4146 # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py
42 # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
47 # CHECK-OUT-COMMON: Timeout: Reached timeout of 2 seconds
4348 # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
4449
4550 # CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py