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 11#!/uar/bin/env python3
22
3+ import platform
34import subprocess
45import sys
5- import threading
66
7+ sampleCommand = None
8+ timeoutSampleTime = 0
79
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 ):
916 process = subprocess .Popen (command )
10- timer = threading .Timer (timeout , process .kill )
1117 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 :])))
1627
1728
1829if __name__ == '__main__' :
Original file line number Diff line number Diff line change 66// If the compiler needs more than 5 minutes, there is probably a real problem.
77// So please don't just increase the timeout in case this fails.
88
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
1014
1115// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
1216// REQUIRES: long_test
You can’t perform that action at this time.
0 commit comments