From b61df33b1f08e651c691d718c0e6fee25539f376 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 25 Jan 2025 08:53:29 +0000 Subject: [PATCH] CI: Kill proc when ready in startup_checks.py --- tools/ci/startup_checks.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/ci/startup_checks.py b/tools/ci/startup_checks.py index 837fda2e9be..535b7d74e54 100644 --- a/tools/ci/startup_checks.py +++ b/tools/ci/startup_checks.py @@ -8,14 +8,19 @@ from queue import Queue, Empty TEN_MINUTES_IN_SECONDS = 600 -CHECK_INTERVAL_SECONDS = 5 +CHECK_INTERVAL_SECONDS = 2.5 + + +def kill(process): + """Send SIGTERM to a running process.""" + if process.poll() is None: # still running + process.send_signal(signal.SIGTERM) def kill_all(processes): """Send SIGTERM to all running processes.""" for proc in processes: - if proc.poll() is None: # still running - proc.send_signal(signal.SIGTERM) + kill(proc) def reader_thread(proc, output_queue): @@ -128,12 +133,11 @@ def main(): if "ready to work" in lower_line: print(f"==> {proc.args[0]} is ready!") ready_status[proc] = True + kill(proc) # Check if all processes are marked ready if all(ready_status.values()): - print( - "All processes reached 'ready to work'! Killing them and exiting successfully." - ) + print("All processes reached 'ready to work'! Exiting successfully.") kill_all(processes) exit(0)