From bfccd0bf041d8ccddea8a742f285a2dede0a4bdb Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 26 Oct 2026 07:33:54 +0000 Subject: [PATCH] test(run_manager): wait on a wall-clock deadline in recovery tests The reconciliation helper polled a fixed number of yields, which a loaded CI runner could exhaust before cleanup tasks were scheduled. It now polls against a ten second deadline with a short sleep between attempts, so the assertion reflects whether recovery actually completed rather than how quickly the scheduler ran. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .../src/run_manager_actor_recovery_tests.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/tinyflows-module/src/run_manager_actor_recovery_tests.rs b/crates/tinyflows-module/src/run_manager_actor_recovery_tests.rs index 01f1d2fa..093b4a9a 100644 --- a/crates/tinyflows-module/src/run_manager_actor_recovery_tests.rs +++ b/crates/tinyflows-module/src/run_manager_actor_recovery_tests.rs @@ -372,7 +372,10 @@ async fn assert_reconciled( storage: &CatalogStorage, ) { let mut settled = None; - for _ in 0..128 { + // Cleanup runs on other tasks; wait on a wall-clock deadline, not a fixed number of yields, + // so a loaded CI runner cannot exhaust the budget before the work is scheduled. + let deadline = std::time::Instant::now() + std::time::Duration::from_secs(10); + while std::time::Instant::now() < deadline { let row = catalog.get_flow_run(run_id).await.unwrap().unwrap(); let events = catalog.flow_run_events_after(run_id, 0, 20).await.unwrap(); if row.status == "interrupted" @@ -385,7 +388,7 @@ async fn assert_reconciled( settled = Some((row, events)); break; } - tokio::task::yield_now().await; + tokio::time::sleep(std::time::Duration::from_millis(5)).await; } let (row, events) = settled.expect("actor recovery must finish its durable cleanup"); assert_eq!(row.status, "interrupted");