From 898a250c9f2b84291a71e4fad7bc339533a909c4 Mon Sep 17 00:00:00 2001 From: lda Date: Thu, 10 Sep 2026 00:08:36 +0700 Subject: [PATCH] test: await scheduler history settlement --- tests/wf_server/test_scheduler_integration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/wf_server/test_scheduler_integration.py b/tests/wf_server/test_scheduler_integration.py index fc84845c..73de92f7 100644 --- a/tests/wf_server/test_scheduler_integration.py +++ b/tests/wf_server/test_scheduler_integration.py @@ -544,6 +544,7 @@ async def test_interrupt_restart_resume_reinterrupt(tmp_path: Path) -> None: FileRunStore(root).get_run(run_id).latest_checkpoint_id == f"{run_id}.000001" ) + await _wait_for(lambda: len(_entries(root, "asker", "interrupted")) == 1) assert len(_entries(root, "asker", "interrupted")) == 1 finally: await first.stop() @@ -927,6 +928,7 @@ async def test_paused_deleted_run_completion( await _wait_for( lambda: FileRunStore(root).get_run(gated_id).status.value == "completed" ) + await _wait_for(lambda: len(_entries(root, "pausable", "completed")) == 1) assert len(_entries(root, "pausable", "completed")) == 1 # A paused double-interrupt schedule still resumes through the API. @@ -985,6 +987,7 @@ async def test_paused_deleted_run_completion( await _wait_for( lambda: FileRunStore(root).get_run(doomed_id).status.value == "completed" ) + await _wait_for(lambda: len(_entries(root, "doomed", "completed")) == 1) assert len(_entries(root, "doomed", "completed")) == 1 with pytest.raises(ScheduleExistsError): FileScheduleStore(root).create_schedule(