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