Skip to content

Commit 35f8f3b

Browse files
committed
Fix flaky test caught by aarch64 musl
1 parent 5b018da commit 35f8f3b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/golden.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ fn golden_test_failure(args: &[&str], input: &str, err_ex: &str) -> io::Result<(
7575
use io::Write;
7676
{
7777
let mut stdin = child.stdin.take().unwrap();
78-
stdin.write_all(input.as_bytes())?;
78+
// Some failures happen during argument parsing before stdin is read.
79+
// In that case the child may exit early and close the pipe first.
80+
match stdin.write_all(input.as_bytes()) {
81+
Ok(()) => {}
82+
Err(err) if err.kind() == io::ErrorKind::BrokenPipe => {}
83+
Err(err) => return Err(err),
84+
}
7985
drop(stdin);
8086
}
8187

0 commit comments

Comments
 (0)