fix: report proxy shutdown failures

This commit is contained in:
2026-09-22 15:23:46 +08:00
parent ca707761fc
commit 42021538b2

View File

@@ -226,8 +226,12 @@ def main() -> None:
assert backend.stdin is not None assert backend.stdin is not None
backend.stdin.write('"stop"\n') backend.stdin.write('"stop"\n')
backend.stdin.flush() backend.stdin.flush()
if backend.wait(timeout=5) != 0: exit_code = backend.wait(timeout=5)
raise AssertionError("native server did not shut down cleanly behind Nginx") if exit_code != 0:
details = backend.stderr.read().strip() if backend.stderr is not None else ""
raise AssertionError(
f"native server did not shut down cleanly behind Nginx: exit={exit_code} {details}"
)
print("PASS native graceful shutdown behind proxy", flush=True) print("PASS native graceful shutdown behind proxy", flush=True)
finally: finally:
if nginx is not None and nginx.poll() is None: if nginx is not None and nginx.poll() is None: