test(daemon): a dead pane's refusal may come after it is reaped (#1170)

send_input_to_a_dead_pane_answers_an_error raced the reaper: the session
ending after Exited lets the server drop the dead pane, so the input can
find no pane at all and answer "no such pane". Both are refusals.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Adam Hitchcock
2026-10-13 19:25:45 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 523d834eb8
commit d2d3793f50
+4 -1
View File
@@ -260,8 +260,11 @@ fn send_input_to_a_dead_pane_answers_an_error() {
let err = panes
.send_input(pane_id, b"echo too_late\r")
.expect_err("input into an exited pane must fail");
// The session's end lets the server reap the dead pane, so input that
// arrives after the reap finds no pane at all; both are refusals.
let err = err.to_string();
assert!(
err.to_string().contains("not running"),
err.contains("not running") || err.contains("no such pane"),
"the refusal was {err}"
);
}