From 2af5f6227217758aa094a4b43054a17c4d0d5824 Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Sun, 8 Nov 2026 20:30:10 -0800 Subject: [PATCH] test(gateway): take any whole seconds in a deploy's websites-not-ready message _wait_for_websites says how long it waited, the time measured, in whole seconds. Three tests matched "after 0s", which holds only while the wait takes under a second; on a loaded runner it took one, and CodeBuild's unit run failed on "websites not ready after 1s". They now match any whole seconds, and still match the rest of the message exactly. Co-Authored-By: Claude Opus 5.5 --- .../providers/env_providers/env_gateway_provider_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tst/unit/providers/env_providers/env_gateway_provider_test.py b/tst/unit/providers/env_providers/env_gateway_provider_test.py index 7529394cf..ea8d6f10a 100644 --- a/tst/unit/providers/env_providers/env_gateway_provider_test.py +++ b/tst/unit/providers/env_providers/env_gateway_provider_test.py @@ -2605,7 +2605,7 @@ def site(request: httpx.Request) -> httpx.Response: return httpx.Response(200, json=_READY_CARD) return httpx.Response(200, json={"ready": False, "problems": ["seeded"]}) - with _sites(site), pytest.raises(RuntimeError, match=r"websites not ready after 0s: mail \(seeded\)"): + with _sites(site), pytest.raises(RuntimeError, match=r"websites not ready after \d+s: mail \(seeded\)"): await env_gateway_provider._wait_for_websites( "http://gw", [WebsiteConfig(backend_image="m", frontend_image=None, environment_name="mail")], timeout_s=0, poll_s=0) @@ -2618,7 +2618,7 @@ def site(request: httpx.Request) -> httpx.Response: return httpx.Response(200, json=_READY_CARD) return httpx.Response(200, json={"ready": "yes"}) - with _sites(site), pytest.raises(RuntimeError, match=r"websites not ready after 0s: mail \(ValidationError: "): + with _sites(site), pytest.raises(RuntimeError, match=r"websites not ready after \d+s: mail \(ValidationError: "): await env_gateway_provider._wait_for_websites( "http://gw", [WebsiteConfig(backend_image="m", frontend_image=None, environment_name="mail")], timeout_s=0, poll_s=0) @@ -2651,7 +2651,7 @@ def site(request: httpx.Request) -> httpx.Response: return httpx.Response(200, json={"ready": False, "problems": ["@ready_check seeded returned False"], "waited_s": 61, "timeout_s": 0}) - with _sites(site), pytest.raises(RuntimeError, match=r"websites not ready after 0s: mail \(not ready after 0 s: " + with _sites(site), pytest.raises(RuntimeError, match=r"websites not ready after \d+s: mail \(not ready after 0 s: " r"@ready_check seeded returned False\)"): await env_gateway_provider._wait_for_websites( "http://gw", [WebsiteConfig(backend_image="m", frontend_image=None, environment_name="mail")],