fix: handle TimeoutExpired in server --stdio pre-flight check
This commit is contained in:
@@ -368,11 +368,14 @@ def preflight_checks():
|
|||||||
errors.append("SSH detection failed")
|
errors.append("SSH detection failed")
|
||||||
|
|
||||||
print(" [3] Server --stdio flag...", end=" ")
|
print(" [3] Server --stdio flag...", end=" ")
|
||||||
r = subprocess.run(["./build/server", "--stdio"], capture_output=True, text=True, timeout=3)
|
try:
|
||||||
if r.returncode != 0 and ("receiving" in r.stderr or "receiving" in r.stdout or "Receiving" in r.stderr):
|
r = subprocess.run(["./build/server", "--stdio"], capture_output=True, text=True, timeout=3)
|
||||||
print("OK (started in stdio mode)")
|
if r.returncode != 0 and ("receiving" in r.stderr or "receiving" in r.stdout or "Receiving" in r.stderr):
|
||||||
else:
|
print("OK (started in stdio mode)")
|
||||||
print("WARN (stdio exited: rc=%d)" % r.returncode)
|
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=" ")
|
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)
|
r = subprocess.run(BASE_CLIENT_CMD + ["/tmp/x", "/tmp/y"], capture_output=True, text=True, timeout=5)
|
||||||
|
|||||||
Reference in New Issue
Block a user