Make deadline reminder polling eligibility-aware #718

Merged
timmy merged 2 commits from timmy/717-deadline-eligibility into main 2026-08-13 07:29:21 +00:00
Showing only changes of commit 93890e72de - Show all commits

View File

@ -238,6 +238,7 @@ async def test_deadline_reminders_bound_fanout_and_isolate_failed_devices(tmp_pa
)
active = 0
peak = 0
two_active = asyncio.Event()
async def assigned():
return {"complete": True, "items": [{"id": 1, "due_date": "2026-08-14T00:00:00Z"}]}
@ -246,7 +247,9 @@ async def test_deadline_reminders_bound_fanout_and_isolate_failed_devices(tmp_pa
nonlocal active, peak
active += 1
peak = max(peak, active)
await asyncio.sleep(0.01)
if active == 2:
two_active.set()
await asyncio.wait_for(two_active.wait(), timeout=0.5)
active -= 1
if subscription["endpoint"].endswith("device-1"):
raise RuntimeError("provider failed")