tests: wait on the stand-down latch instead of racing the 503
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-10-05 14:11:31 +02:00
parent 25dc49363b
commit e42189faa7

View File

@ -57,7 +57,9 @@ class TestStaleServerRefuses:
_running() as port,
):
_get(port, "/api/budget")
assert _web_server._RETIRING.is_set()
# The 503 is sent before the latch is set, so the client can read
# it first: wait rather than race (flaked in CI on 25dc493).
assert _web_server._RETIRING.wait(timeout=5)
self._clear_retiring()
def test_a_second_refusal_does_not_stand_down_twice(