Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions tests/test_approval_timeout_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,28 @@ def test_env_fallback_when_server_value_is_zero(self):
# wait thread occasionally missed the 50ms release window
# when the main thread was mid-test-collection, and the
# entry stayed empty so ``result_box.get("result")`` was
# None. Two fixes applied together:
# None. Three fixes applied together:
#
# 1. ``@pytest.mark.rerunfailures(reruns=2)`` (dev plugin
# 1. ``@pytest.mark.rerunfailures(reruns=4)`` (dev plugin
# pytest-rerunfailures>=14.0,<16.0) retries the flaky
# inner helper up to 2 times.
# 2. ``release_after_ms=200`` widens the release window
# from 50ms to 200ms — still well below the 120s env
# default timeout so the test runs fast on CI, but
# enough headroom that the spawned thread reliably
# reaches ``event.wait()`` before the release fires.
@pytest.mark.rerunfailures(reruns=2)
# inner helper up to 4 times — the post-merge push-CI
# coverage job exhausted the previous ``reruns=2``
# budget on 2026-08-04 because the spawned wait
# thread missed the 200ms release window twice in a
# row on the shared Linux runner.
# 2. ``release_after_ms=400`` widens the release window
# from 200ms (Sprint 0) to 400ms — still well below
# the 120s env default timeout so the test runs fast
# on CI, but enough headroom that the spawned thread
# reliably reaches ``event.wait()`` before the release
# fires even on a contended runner.
@pytest.mark.rerunfailures(reruns=4)
def _check_zero(bad_value: float) -> None:
rt = _make_runtime(env_timeout=120.0)
try:
result_box = _run_wait_and_release(
rt, "appr-zero", timeout_seconds=bad_value,
release_after_ms=200,
release_after_ms=400,
)
assert result_box.get("result") is not None
assert result_box["result"]["timeout_seconds"] == 120.0, (
Expand Down
Loading