diff --git a/swarm-builder/src/nix_build.rs b/swarm-builder/src/nix_build.rs index 6a5721cb..23c22507 100644 --- a/swarm-builder/src/nix_build.rs +++ b/swarm-builder/src/nix_build.rs @@ -346,11 +346,15 @@ mod tests { .stdout(Stdio::piped()) .spawn() .expect("sh runs"); - write!( + // The helper exits without reading the request for any op but `get`, + // so the write can hit EPIPE. `git` ignores EPIPE here too. + let written = write!( child.stdin.take().expect("piped"), "protocol={protocol}\nhost={host}\npath=agent-configs/atlas\n\n" - ) - .expect("the helper reads its request"); + ); + if let Err(e) = written { + assert_eq!(e.kind(), std::io::ErrorKind::BrokenPipe, "{e}"); + } let out = child.wait_with_output().expect("the helper exits"); assert!(out.status.success()); String::from_utf8(out.stdout).expect("utf-8")