File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed
validation-test/SILOptimizer Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 1
1
#!/uar/bin/env python3
2
2
3
+ import platform
3
4
import subprocess
4
5
import sys
5
- import threading
6
6
7
+ sampleCommand = None
8
+ timeoutSampleTime = 0
7
9
8
- def watchdog (command , timeout = None ):
10
+ if platform .system () == 'Darwin' :
11
+ sampleCommand = '/usr/bin/sample'
12
+ timeoutSampleTime = 10
13
+
14
+
15
+ def watchdog (command , timeout ):
9
16
process = subprocess .Popen (command )
10
- timer = threading .Timer (timeout , process .kill )
11
17
try :
12
- timer .start ()
13
- process .communicate ()
14
- finally :
15
- timer .cancel ()
18
+ process .wait (timeout = timeout )
19
+ except subprocess .TimeoutExpired :
20
+ if sampleCommand :
21
+ pidstr = str (process .pid )
22
+ subprocess .run ([sampleCommand , pidstr , str (timeoutSampleTime )])
23
+ process .kill ()
24
+ sys .exit (
25
+ 'error: command timed out after {} seconds: {}'
26
+ .format (timeout , ' ' .join (sys .argv [2 :])))
16
27
17
28
18
29
if __name__ == '__main__' :
Original file line number Diff line number Diff line change 6
6
// If the compiler needs more than 5 minutes, there is probably a real problem.
7
7
// So please don't just increase the timeout in case this fails.
8
8
9
- // RUN: %{python} %S/../../test/Inputs/timeout.py 240 %target-swift-frontend -O -parse-as-library -sil-verify-none -c %t/main.swift -o %t/main.o
9
+ // TEMPORARY NOTE: The timeout has been raised to 2400 seconds while we
10
+ // investigate timeouts in CI runs of this test. This should be set back to the
11
+ // original time of 240 seconds once that's been figured out.
12
+
13
+ // RUN: %{python} %S/../../test/Inputs/timeout.py 2400 %target-swift-frontend -O -parse-as-library -sil-verify-none -c %t/main.swift -o %t/main.o
10
14
11
15
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
12
16
// REQUIRES: long_test
You can’t perform that action at this time.
0 commit comments