test(scm): hold the graph idle test's daemon end open

`&mut { _pane }` moved the pane's daemon-side handle into a temporary and
dropped it at the end of the statement, closing the link a line after the
`Cwd` was written into it. On Unix that is harmless: a closed `socketpair`
half still hands the peer everything already queued. This module now runs
on Windows, where the link is a loopback `TcpStream` and the pane has by
then written its own `Resize` back — closing a socket with unread data on
it is an abortive close, so the `Cwd` can be discarded with the
connection. The test would not fail; `settle_graph` would spend its 30s
deadline and return early, and the assertions would be skipped.

Hold the handle for the life of the test, the way `file_tree`, `panel` and
`detail` already hold theirs.
This commit is contained in:
l0ng-ai
2026-09-07 22:19:11 +08:00
parent b7e56c480a
commit e94ea46147
+9 -2
View File
@@ -2286,9 +2286,16 @@ mod render_idle_gpui_tests {
));
}
let (app, mut vcx, _pane) = test_window::harness_with_pane(cx);
// The daemon end is held for the life of the test, the way every other
// panel harness holds it. `&mut { _pane }` dropped it on the spot: on
// Unix a closed `socketpair` half still delivers the `Cwd` written a
// moment earlier, but on Windows the link is a loopback `TcpStream`,
// and closing one with the pane's own `Resize` sitting unread on it is
// an abortive close — the `Cwd` goes with the connection, and the test
// spends its 30s deadline waiting for a cwd that was thrown away.
let (app, mut vcx, mut pane) = test_window::harness_with_pane(cx);
crate::daemon::protocol::DaemonMsg::Cwd(root.clone())
.encode(&mut { _pane })
.encode(&mut pane)
.expect("the pane's socket takes the cwd");
app.update_in(&mut vcx, |app, _, cx| {
app.right_panel_visible = true;