Dont hang forever if test process doesnt quit

This commit is contained in:
Kovid Goyal 2023-10-17 05:55:14 +05:30
parent a48a0fc52f
commit 0c7aa15980
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -63,7 +63,11 @@ def run(*args):
if len(args) == 1:
args = shlex.split(args[0])
print(' '.join(args), flush=True)
ret = subprocess.Popen(args).wait()
try:
ret = subprocess.Popen(args).wait(timeout=600)
except subprocess.TimeoutExpired as err:
print(err, file=sys.stderr, flush=True)
print('Timed out running:', ' '.join(args), flush=True, file=sys.stderr)
if ret != 0:
raise SystemExit(ret)