From b0a8dcb385d7d2faa64f5fcf7123e20e6622cb09 Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 24 Nov 2026 15:26:29 +0100 Subject: [PATCH] automation: the unasked-line test writes its line in one write, so the client's close can't reset the newline (BrokenPipe on Linux CI) Co-Authored-By: Claude Opus 5.5 --- crates/automation/src/client_tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/automation/src/client_tests.rs b/crates/automation/src/client_tests.rs index 4718057ea8..0514a62d39 100644 --- a/crates/automation/src/client_tests.rs +++ b/crates/automation/src/client_tests.rs @@ -88,7 +88,10 @@ fn an_unasked_line_makes_the_connection_unusable_before_sending() { reader.read_line(&mut line).unwrap(); writeln!(out, "{}", json!({"id": 1, "ok": true})).unwrap(); wait.recv().unwrap(); - writeln!(out, "{}", json!({"id": null, "ok": false, "error": "idle connection closed"})).unwrap(); + // One write: `writeln!` on a bare stream sends the line and its newline apart, and the client closes on + // the first bytes, so the newline met a reset (BrokenPipe) now and then. + let unasked = format!("{}\n", json!({"id": null, "ok": false, "error": "idle connection closed"})); + out.write_all(unasked.as_bytes()).unwrap(); out.flush().unwrap(); // The client's close shows as an end of input or, with the unread line, a reset. line.clear();