tests: pin the delegate-hold backoff floor by presence, not position

The test patches the GLOBAL time.sleep, so a daemon thread leaked by an
earlier test on the same xdist worker (a 0.5 s poll loop) records its
sleeps too; on windows-latest (rc.13 dispatch run) sleeps[0] was such a
0.5 and the assertion on the first element failed although the second
hold cycle did sleep its backoff floor. The pin now asserts that a
backoff sleep between the floor (4.0 s) and the cap (15.0 s) happened.

Co-authored-by: Ouroboros <311266734+ouroboros-agent@users.noreply.github.com>
This commit is contained in:
Ouroboros 2026-09-05 03:52:59 +00:00
parent 51a96095f1
commit baed65ae4b

View file

@ -300,7 +300,10 @@ def test_repeated_unknown_reholds_with_backoff_floor(tmp_path, monkeypatch, _qui
cycle_counts = [row["hold_cycles"] for row in _read_hold_events(tmp_path)
if row["phase"] == "entered"]
assert cycle_counts == [1, 2]
assert sleeps and sleeps[0] >= 4.0 # backoff floor on the second cycle
# The patch is on the GLOBAL time.sleep, so a daemon thread leaked by an earlier test on the
# same xdist worker (a 0.5 s poll loop; windows-latest, rc.13 dispatch) lands in ``sleeps``
# too: pin the backoff floor of the second cycle by presence, not by position.
assert any(4.0 <= sec <= 15.0 for sec in sleeps), sleeps # backoff floor on the second cycle
def test_refused_probe_and_state_less_payload_never_hold(tmp_path, monkeypatch, _quiet_probe):