fix: keep proxy verifier control stdin
This commit is contained in:
@@ -180,7 +180,7 @@ def main() -> None:
|
|||||||
write_edge_certificate(directory)
|
write_edge_certificate(directory)
|
||||||
backend = subprocess.Popen(
|
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",
|
"--network", "host", "--cpus=1", "--memory=512m", "--pids-limit=512",
|
||||||
"-v", f"{root}:/workspace", "-w", "/workspace", "-e", "GOWORK=off",
|
"-v", f"{root}:/workspace", "-w", "/workspace", "-e", "GOWORK=off",
|
||||||
args.image, "sh", "-c", "go run ./internal/perfcheck --server native --tls",
|
args.image, "sh", "-c", "go run ./internal/perfcheck --server native --tls",
|
||||||
@@ -233,21 +233,8 @@ def main() -> None:
|
|||||||
) from error
|
) from error
|
||||||
verify_keep_alive(edge_port)
|
verify_keep_alive(edge_port)
|
||||||
verify_timeout(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)
|
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.stdin is not None
|
||||||
assert backend.stdout is not None
|
assert backend.stdout is not None
|
||||||
backend.stdin.write('"snapshot"\n')
|
backend.stdin.write('"snapshot"\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user