Watch
0
0
Fork
You've already forked hyperhive
0

swarm-builder: let the helper test tolerate epipe like git does

This commit is contained in:
atlas 2026-10-17 11:31:01 +02:00 • committed by mara
commit f03dcd0f31

View file

@ -346,11 +346,15 @@ mod tests {
.stdout(Stdio::piped()) .stdout(Stdio::piped())
.spawn() .spawn()
.expect("sh runs"); .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"), child.stdin.take().expect("piped"),
"protocol={protocol}\nhost={host}\npath=agent-configs/atlas\n\n" "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"); let out = child.wait_with_output().expect("the helper exits");
assert!(out.status.success()); assert!(out.status.success());
String::from_utf8(out.stdout).expect("utf-8") String::from_utf8(out.stdout).expect("utf-8")