test(maestro): fix borrow-after-partial-move in recover regression test
ci / rust (push) Successful in 2m51s
ci / rust (push) Successful in 2m51s
Capture sidecar_dir/fifo_dir/tmux/worktree_root before `drop(fx.manager)` so the post-drop builder calls don't need to reborrow the partially-moved fixture. Pure compile fix — same scenario as before. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -130,19 +130,28 @@ async fn recover_re_pipes_pane_so_output_reaches_subscribers() {
|
||||
.await
|
||||
.expect("create");
|
||||
|
||||
// Drop the original manager. The previous daemon's `pipe-pane` is still
|
||||
// running against tmux, pointing at a FIFO no one reads now.
|
||||
// Capture paths + tmux handle before dropping the original manager —
|
||||
// `drop(fx.manager)` partially moves `fx` so we can't call its helpers
|
||||
// afterwards.
|
||||
let sidecar_dir = fx.sidecar_dir();
|
||||
let fifo_dir = fx.fifo_dir();
|
||||
let tmux = fx.tmux.tmux.clone();
|
||||
let worktree_root = fx.worktree_root.path().to_path_buf();
|
||||
|
||||
// Drop the original manager. Its PtyBridge closes the FIFO's only
|
||||
// reader, so tmux's `cat >> fifo` writer hits SIGPIPE and exits — but
|
||||
// tmux's pipe-pane bookkeeping still thinks the pane is piped. That's
|
||||
// exactly the stale state recover() has to overwrite.
|
||||
drop(fx.manager);
|
||||
|
||||
let sidecar = maestro_daemon::sidecar::SidecarStore::new(fx.sidecar_dir());
|
||||
let worktree_mgr =
|
||||
maestro_daemon::worktree::WorktreeManager::new(fx.worktree_root.path().to_path_buf());
|
||||
let sidecar = maestro_daemon::sidecar::SidecarStore::new(sidecar_dir);
|
||||
let worktree_mgr = maestro_daemon::worktree::WorktreeManager::new(worktree_root);
|
||||
let revived = maestro_daemon::SessionManager::new(
|
||||
"laptop".to_string(),
|
||||
fx.tmux.tmux.clone(),
|
||||
tmux,
|
||||
sidecar,
|
||||
worktree_mgr,
|
||||
fx.fifo_dir(),
|
||||
fifo_dir,
|
||||
);
|
||||
assert_eq!(revived.recover().await.expect("recover"), 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user