docs/test: align scheduling cleanup

This commit is contained in:
lda
2026-09-10 05:26:40 +07:00 Verified
parent 4474135301
commit 422dd57db6
8 changed files with 59 additions and 35 deletions
+4 -2
View File
@@ -265,8 +265,10 @@ async def test_settlement_does_not_block_the_event_loop(
await service.start()
service.schedule_store.create_schedule(_sched_model("a", intended))
await service.poll_once(intended + timedelta(seconds=1))
await asyncio.sleep(0.05)
assert settlement_started.is_set()
# The worker releases itself after two seconds as failure-safe cleanup.
# Keep this bounded wait shorter than that timeout so the assertion
# observes the intentionally blocked settlement rather than its guard.
assert await asyncio.to_thread(settlement_started.wait, 1.0)
assert not settlement_finished.is_set()
assert service.live_executions == 1
release.set()