From efbccb4e1138bb6ff23a2285c0f62807dc3a8e21 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 24 Aug 2026 22:41:54 +0100 Subject: [PATCH] fix(maestro): wait for settle in pristine natural-exit test Dead status is observable a moment before the settle step removes the worktree, so the assertions raced the removal under parallel load. Wait for the tree to be gone and the store to stay empty, same as the retained-store wait cfebfd4 added to the guarded sibling. Fixes #113 --- crates/maestro-daemon/tests/session_manager.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/maestro-daemon/tests/session_manager.rs b/crates/maestro-daemon/tests/session_manager.rs index e0ec6cf..ece2cf1 100644 --- a/crates/maestro-daemon/tests/session_manager.rs +++ b/crates/maestro-daemon/tests/session_manager.rs @@ -848,6 +848,17 @@ async fn natural_exit_of_a_pristine_worktree_removes_it() { }) .await; + // (`Dead` is observable a moment before the settle step removes the tree.) + wait_for_async(Duration::from_secs(3), || async { + !wt_path.exists() + && fx + .retained_store() + .load_all() + .map(|all| all.is_empty()) + .unwrap_or(false) + }) + .await; + assert!( !wt_path.exists(), "a pristine worktree leaves nothing behind"