From 557a818eaac4a6e2a417e7d4f94b8833c1d1b1df Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Sat, 15 Aug 2026 22:52:51 -0500 Subject: [PATCH] listener contract: wait out the startup gate before asserting the serving surface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /readyz 200 now means accepting, not serving — listeners bind before storage opens. the 101 assert raced the gate on heavypad. Co-Authored-By: Claude Fable 5 --- tests/listener_contract.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/listener_contract.py b/tests/listener_contract.py index 158b4b4..608aa2c 100644 --- a/tests/listener_contract.py +++ b/tests/listener_contract.py @@ -114,6 +114,14 @@ def main() -> None: ) assert wait_for(process, debug_port, "/healthz") == (200, b"ok\n") assert request(debug_port, "/readyz") == (200, b"ok\n") + # Listeners now bind BEFORE storage opens (upstream's server-first + # startup): /readyz 200 means accepting, not serving. Wait out the + # startup gate — /status says "starting" and subscribe 503s until + # main publishes the stores — before asserting the serving contract. + deadline = time.time() + 30 + while b"state starting" in request(public_port, "/status")[1]: + assert time.time() < deadline, "startup gate never opened" + time.sleep(0.05) for path in ("/healthz", "/readyz", "/metrics"): assert request(debug_port, path, "HEAD")[0] == 200, path assert request(debug_port, path, "HEAD")[1] == b"", path -- 2.51.2