docs/test: align scheduling cleanup
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user