From c0dfa52f6774cbb4fe48e2230dad17d96d521a02 Mon Sep 17 00:00:00 2001 From: TapTap Date: Mon, 6 Jul 2026 18:49:02 +0200 Subject: [PATCH] fix: handle TimeoutExpired in server --stdio pre-flight check --- test.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test.py b/test.py index 6c48e8a..c5b63f5 100755 --- a/test.py +++ b/test.py @@ -368,11 +368,14 @@ def preflight_checks(): errors.append("SSH detection failed") print(" [3] Server --stdio flag...", end=" ") - r = subprocess.run(["./build/server", "--stdio"], capture_output=True, text=True, timeout=3) - if r.returncode != 0 and ("receiving" in r.stderr or "receiving" in r.stdout or "Receiving" in r.stderr): - print("OK (started in stdio mode)") - else: - print("WARN (stdio exited: rc=%d)" % r.returncode) + try: + r = subprocess.run(["./build/server", "--stdio"], capture_output=True, text=True, timeout=3) + if r.returncode != 0 and ("receiving" in r.stderr or "receiving" in r.stdout or "Receiving" in r.stderr): + print("OK (started in stdio mode)") + else: + print("WARN (stdio exited: rc=%d)" % r.returncode) + except subprocess.TimeoutExpired: + print("OK (waiting for stdin)") print(" [4] Posix arg syntax (no server, expect failure)...", end=" ") r = subprocess.run(BASE_CLIENT_CMD + ["/tmp/x", "/tmp/y"], capture_output=True, text=True, timeout=5)