From 61d8ba2b7b60c3181258508954bd83c99aff1397 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 25 Apr 2024 13:06:39 +0200 Subject: test remote runners: Add timeout for running execute and serve The runners used in tests that rely on execution or serve endpoints to exist can get stuck waiting for these to become online if for some reason they cannot be set up. This commit fixes this issue by setting a reasonable timeout, after which we fail gracefully. --- test/end-to-end/with_serve_test_runner.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/end-to-end/with_serve_test_runner.py') diff --git a/test/end-to-end/with_serve_test_runner.py b/test/end-to-end/with_serve_test_runner.py index a71758fd..a7e7861b 100755 --- a/test/end-to-end/with_serve_test_runner.py +++ b/test/end-to-end/with_serve_test_runner.py @@ -253,7 +253,15 @@ serve_proc = subprocess.Popen( stderr=servestderr, ) +timeout: int = 30 while not os.path.exists(SERVE_INFO): + if timeout == 0: + result = "FAIL" + stdout = "Failed to start serve service" + serve_proc.terminate() + dump_results() + exit(1) + timeout -= 1 time.sleep(1) with open(SERVE_INFO) as f: -- cgit v1.2.3