From 0c7aa15980c137299eec21e8ffc55eb38a3caa45 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 17 Oct 2023 05:55:14 +0530 Subject: [PATCH] Dont hang forever if test process doesnt quit --- setup/unix-ci.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup/unix-ci.py b/setup/unix-ci.py index e3acaeeb6d..020cb762d3 100644 --- a/setup/unix-ci.py +++ b/setup/unix-ci.py @@ -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)