mirror of
https://github.com/razzant/ouroboros.git
synced 2026-10-03 04:07:04 +00:00
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:
parent
51a96095f1
commit
baed65ae4b
1 changed files with 4 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue