diff --git a/crates/maestro-daemon/tests/session_manager.rs b/crates/maestro-daemon/tests/session_manager.rs index c90d9cc..e0ec6cf 100644 --- a/crates/maestro-daemon/tests/session_manager.rs +++ b/crates/maestro-daemon/tests/session_manager.rs @@ -769,6 +769,14 @@ async fn natural_exit_of_a_guarded_worktree_retains_it_in_the_store() { "a dirty worktree must be retained on natural exit" ); // ...in the store, under the exit reason. + // (`Dead` is observable a moment before the settle step's store write lands.) + wait_for_async(Duration::from_secs(3), || async { + fx.retained_store() + .load_all() + .map(|all| all.len() == 1) + .unwrap_or(false) + }) + .await; let all = fx.retained_store().load_all().expect("load_all"); assert_eq!(all.len(), 1); assert_eq!(all[0].path, wt_path);