From 35b7470be2129019cea8c472f2dd81c53bd54b4d Mon Sep 17 00:00:00 2001 From: k2safe Date: Tue, 22 Sep 2026 17:35:51 +0800 Subject: [PATCH] fix: keep proxy verifier control stdin --- scripts/verifyProxy.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/scripts/verifyProxy.py b/scripts/verifyProxy.py index bc4d726..3d061d9 100644 --- a/scripts/verifyProxy.py +++ b/scripts/verifyProxy.py @@ -180,7 +180,7 @@ def main() -> None: write_edge_certificate(directory) backend = subprocess.Popen( [ - "docker", "run", "--rm", "--pull=missing", "--name", backend_name, + "docker", "run", "--rm", "-i", "--pull=missing", "--name", backend_name, "--network", "host", "--cpus=1", "--memory=512m", "--pids-limit=512", "-v", f"{root}:/workspace", "-w", "/workspace", "-e", "GOWORK=off", args.image, "sh", "-c", "go run ./internal/perfcheck --server native --tls", @@ -233,21 +233,8 @@ def main() -> None: ) from error verify_keep_alive(edge_port) verify_timeout(edge_port) - # The upstream /slow handler intentionally runs for two seconds. - # Nginx has already returned 504, but it may keep the upstream - # socket around while native drains that request. Let it finish - # before checking a clean listener shutdown. - time.sleep(2.2) print("PASS Nginx TLS proxy, Keep-Alive and upstream timeout", flush=True) - # Drain the edge proxy before stopping its upstream, matching a - # rolling deployment where traffic is removed from the old task - # before its listener is shut down. - nginx.terminate() - nginx.wait(timeout=5) - subprocess.run(["docker", "rm", "-f", nginx_name], check=False, - stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - assert backend.stdin is not None assert backend.stdout is not None backend.stdin.write('"snapshot"\n')