sched: select latest eligible occurrence <= now; watermarks never regress (F3)
This commit is contained in:
@@ -256,10 +256,15 @@ def test_long_downtime_is_bounded(tmp_path: Path) -> None:
|
||||
assert src.next_calls + src.prev_calls <= SCAN_CAP + 2
|
||||
admitted = [r for r in _history(store, "m") if r["kind"] == "admitted"]
|
||||
assert len(admitted) == 1
|
||||
assert datetime.fromisoformat(admitted[0]["resolved_at"]) == ts(2026, 9, 8, 11, 59)
|
||||
# Latest-eligible <= now: a poll exactly at a due instant selects that
|
||||
# instant (F3), not its exclusive predecessor.
|
||||
assert datetime.fromisoformat(admitted[0]["resolved_at"]) == ts(2026, 9, 8, 12, 0)
|
||||
assert (
|
||||
len([r for r in _history(store, "m") if r["kind"] == "interval-summary"]) == 1
|
||||
)
|
||||
# A second poll at the same instant admits nothing more.
|
||||
sched.poll(ts(2026, 9, 8, 12, 0, 0))
|
||||
assert len([r for r in _history(store, "m") if r["kind"] == "admitted"]) == 1
|
||||
sched.ownership.release()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user