From 8d39f31a62e34cee07951b3330890ebdc8ae77af Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 18 Apr 2026 09:30:42 -0400 Subject: [PATCH] test(harness): flush workflow store events before returning Flush the async store logger in workflow test helpers before returning so callers that reopen the run store immediately do not observe partial state. This removes the race behind the Linux git checkpoint CI failure. --- lib/crates/fabro-workflow/src/test_support.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/crates/fabro-workflow/src/test_support.rs b/lib/crates/fabro-workflow/src/test_support.rs index d2d51b0a0..fe3282e76 100644 --- a/lib/crates/fabro-workflow/src/test_support.rs +++ b/lib/crates/fabro-workflow/src/test_support.rs @@ -165,6 +165,9 @@ pub async fn run_graph( ) .await; let executed = pipeline::execute(initialized.initialized).await; + // Tests often reopen the run store immediately after `run()` returns. + // Flush the async store logger first so they don't observe partial state. + initialized.store_logger.flush().await; executed.outcome } @@ -189,8 +192,8 @@ pub async fn run_graph_with_state( ) .await; let executed = pipeline::execute(initialized.initialized).await; - let outcome = executed.outcome?; initialized.store_logger.flush().await; + let outcome = executed.outcome?; let state = executed .run_store .state() @@ -222,6 +225,7 @@ pub async fn run_graph_with_hooks( ) .await; let executed = pipeline::execute(initialized.initialized).await; + initialized.store_logger.flush().await; executed.outcome } @@ -248,8 +252,8 @@ pub async fn run_graph_with_hooks_and_state( ) .await; let executed = pipeline::execute(initialized.initialized).await; - let outcome = executed.outcome?; initialized.store_logger.flush().await; + let outcome = executed.outcome?; let state = executed .run_store .state() @@ -280,6 +284,7 @@ pub async fn run_graph_from_checkpoint( ) .await; let executed = pipeline::execute(initialized.initialized).await; + initialized.store_logger.flush().await; executed.outcome } @@ -305,8 +310,8 @@ pub async fn run_graph_from_checkpoint_with_state( ) .await; let executed = pipeline::execute(initialized.initialized).await; - let outcome = executed.outcome?; initialized.store_logger.flush().await; + let outcome = executed.outcome?; let state = executed .run_store .state()