Skip to content

Commit 0a4912e

Browse files
committed
[tests] timeout integration tests on travis after 20 minutes
1 parent 7c51e9f commit 0a4912e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/functional/test_runner.py

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import os
2121
import time
2222
import shutil
23+
import signal
2324
import sys
2425
import subprocess
2526
import tempfile
@@ -389,6 +390,10 @@ def get_next(self):
389390
time.sleep(.5)
390391
for j in self.jobs:
391392
(name, time0, proc, log_out, log_err) = j
393+
if os.getenv('TRAVIS') == 'true' and int(time.time() - time0) > 20 * 60:
394+
# In travis, timeout individual tests after 20 minutes (to stop tests hanging and not
395+
# providing useful output.
396+
proc.send_signal(signal.SIGINT)
392397
if proc.poll() is not None:
393398
log_out.seek(0), log_err.seek(0)
394399
[stdout, stderr] = [l.read().decode('utf-8') for l in (log_out, log_err)]

0 commit comments

Comments
 (0)