1 # REQUIRES: python-psutil
3 # Test per test timeout using external shell
5 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
6 # RUN: %{inputs}/shtest-timeout/quick_then_slow.py \
7 # RUN: %{inputs}/shtest-timeout/short.py \
8 # RUN: %{inputs}/shtest-timeout/slow.py \
9 # RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err
10 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s
11 # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s
13 # CHECK-EXTSH-ERR: Using external shell
15 # Test per test timeout using internal shell
17 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
18 # RUN: %{inputs}/shtest-timeout/quick_then_slow.py \
19 # RUN: %{inputs}/shtest-timeout/short.py \
20 # RUN: %{inputs}/shtest-timeout/slow.py \
21 # RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err
22 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s
23 # RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s
24 # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s
26 # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
27 # CHECK-INTSH-OUT: Command 0 Reached Timeout: True
28 # CHECK-INTSH-OUT: Command 0 Output:
29 # CHECK-INTSH-OUT-NEXT: Running infinite loop
32 # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: quick_then_slow.py
33 # CHECK-INTSH-OUT: Timeout: Reached timeout of 1 seconds
34 # CHECK-INTSH-OUT: Command Output
35 # CHECK-INTSH-OUT: Command 0 Reached Timeout: False
36 # CHECK-INTSH-OUT: Command 0 Output:
37 # CHECK-INTSH-OUT-NEXT: Running in quick mode
38 # CHECK-INTSH-OUT: Command 1 Reached Timeout: True
39 # CHECK-INTSH-OUT: Command 1 Output:
40 # CHECK-INTSH-OUT-NEXT: Running in slow mode
42 # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: slow.py
43 # CHECK-INTSH-OUT: Command 0 Reached Timeout: True
44 # CHECK-INTSH-OUT: Command 0 Output:
45 # CHECK-INTSH-OUT-NEXT: Running slow program
47 # CHECK-INTSH-ERR: Using internal shell
49 # Test per test timeout set via a config file rather than on the command line
51 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
52 # RUN: %{inputs}/shtest-timeout/quick_then_slow.py \
53 # RUN: %{inputs}/shtest-timeout/short.py \
54 # RUN: %{inputs}/shtest-timeout/slow.py \
55 # RUN: -j 1 -v --debug --param external=0 \
56 # RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err
57 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s
58 # RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s
60 # CHECK-CFGSET-ERR: Using internal shell
62 # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py
63 # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
64 # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
65 # CHECK-OUT-COMMON: Running infinite loop
67 # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: quick_then_slow.py
68 # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
69 # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
70 # CHECK-OUT-COMMON: Running in quick mode
71 # CHECK-OUT-COMMON: Running in slow mode
73 # CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py
75 # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: slow.py
76 # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
77 # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
78 # CHECK-OUT-COMMON: Running slow program
80 # CHECK-OUT-COMMON: Expected Passes{{ *}}: 1
81 # CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 3
83 # Test per test timeout via a config file and on the command line.
84 # The value set on the command line should override the config file.
86 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
87 # RUN: %{inputs}/shtest-timeout/quick_then_slow.py \
88 # RUN: %{inputs}/shtest-timeout/short.py \
89 # RUN: %{inputs}/shtest-timeout/slow.py \
90 # RUN: -j 1 -v --debug --param external=0 \
91 # RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err
92 # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s
93 # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
95 # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds
97 # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
98 # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
99 # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
100 # CHECK-CMDLINE-OVERRIDE-OUT: Running infinite loop
102 # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: quick_then_slow.py
103 # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
104 # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
105 # CHECK-CMDLINE-OVERRIDE-OUT: Running in quick mode
106 # CHECK-CMDLINE-OVERRIDE-OUT: Running in slow mode
108 # CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py
110 # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: slow.py
111 # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
112 # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
113 # CHECK-CMDLINE-OVERRIDE-OUT: Running slow program
115 # CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1
116 # CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 3