Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 1 | # REQUIRES: python-psutil |
Jan Korous | 1e0e0b0 | 2018-03-27 00:16:28 +0000 | [diff] [blame] | 2 | # |
| 3 | # rdar://problem/38774530 |
| 4 | # UNSUPPORTED: darwin |
| 5 | # |
Brian Gesiak | 0787253 | 2017-07-26 15:10:50 +0000 | [diff] [blame] | 6 | # PR33944 |
| 7 | # XFAIL: windows |
| 8 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 9 | # Test per test timeout using external shell |
| 10 | # RUN: not %{lit} \ |
| 11 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 12 | # RUN: %{inputs}/shtest-timeout/short.py \ |
| 13 | # RUN: %{inputs}/shtest-timeout/slow.py \ |
| 14 | # RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err |
| 15 | # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s |
| 16 | # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s |
| 17 | # |
| 18 | # CHECK-EXTSH-ERR: Using external shell |
| 19 | |
| 20 | # Test per test timeout using internal shell |
| 21 | # RUN: not %{lit} \ |
| 22 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 23 | # RUN: %{inputs}/shtest-timeout/short.py \ |
| 24 | # RUN: %{inputs}/shtest-timeout/slow.py \ |
| 25 | # RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err |
| 26 | # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s |
| 27 | # RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s |
| 28 | # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 29 | |
Michal Gorny | 1d62f4a | 2016-10-12 21:40:08 +0000 | [diff] [blame] | 30 | # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py |
| 31 | # CHECK-INTSH-OUT: command output: |
| 32 | # CHECK-INTSH-OUT-NEXT: Running infinite loop |
| 33 | # CHECK-INTSH-OUT: command reached timeout: True |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 34 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 35 | # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: slow.py |
Michal Gorny | 1d62f4a | 2016-10-12 21:40:08 +0000 | [diff] [blame] | 36 | # CHECK-INTSH-OUT: command output: |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 37 | # CHECK-INTSH-OUT-NEXT: Running slow program |
Michal Gorny | 1d62f4a | 2016-10-12 21:40:08 +0000 | [diff] [blame] | 38 | # CHECK-INTSH-OUT: command reached timeout: True |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 39 | |
| 40 | # CHECK-INTSH-ERR: Using internal shell |
| 41 | |
| 42 | # Test per test timeout set via a config file rather than on the command line |
| 43 | # RUN: not %{lit} \ |
| 44 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 45 | # RUN: %{inputs}/shtest-timeout/short.py \ |
| 46 | # RUN: %{inputs}/shtest-timeout/slow.py \ |
| 47 | # RUN: -j 1 -v --debug --param external=0 \ |
| 48 | # RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err |
| 49 | # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s |
| 50 | # RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s |
| 51 | # |
| 52 | # CHECK-CFGSET-ERR: Using internal shell |
| 53 | |
| 54 | # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py |
| 55 | # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds |
| 56 | # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output |
| 57 | # CHECK-OUT-COMMON: Running infinite loop |
| 58 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 59 | # CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py |
| 60 | |
| 61 | # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: slow.py |
| 62 | # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds |
| 63 | # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output |
| 64 | # CHECK-OUT-COMMON: Running slow program |
| 65 | |
| 66 | # CHECK-OUT-COMMON: Expected Passes{{ *}}: 1 |
Dan Liew | 7efde3c | 2018-03-28 13:55:08 +0000 | [diff] [blame^] | 67 | # CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 2 |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 68 | |
| 69 | # Test per test timeout via a config file and on the command line. |
| 70 | # The value set on the command line should override the config file. |
| 71 | # RUN: not %{lit} \ |
| 72 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 73 | # RUN: %{inputs}/shtest-timeout/short.py \ |
| 74 | # RUN: %{inputs}/shtest-timeout/slow.py \ |
| 75 | # RUN: -j 1 -v --debug --param external=0 \ |
| 76 | # RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err |
| 77 | # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s |
| 78 | # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s |
| 79 | |
| 80 | # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds |
| 81 | |
| 82 | # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py |
| 83 | # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds |
| 84 | # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output |
| 85 | # CHECK-CMDLINE-OVERRIDE-OUT: Running infinite loop |
| 86 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 87 | # CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py |
| 88 | |
| 89 | # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: slow.py |
| 90 | # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds |
| 91 | # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output |
| 92 | # CHECK-CMDLINE-OVERRIDE-OUT: Running slow program |
| 93 | |
| 94 | # CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1 |
Dan Liew | 7efde3c | 2018-03-28 13:55:08 +0000 | [diff] [blame^] | 95 | # CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 2 |