File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -4975,11 +4975,22 @@ fn close_output() {
4975
4975
let mut buf = [0];
4976
4976
drop(socket.read_exact(&mut buf));
4977
4977
let use_stderr = std::env::var("__CARGO_REPRO_STDERR").is_ok();
4978
- for i in 0..10000 {
4978
+ // Emit at least 1MB of data.
4979
+ // Linux pipes can buffer up to 64KB.
4980
+ // This test seems to be sensitive to having other threads
4981
+ // calling fork. My hypothesis is that the stdout/stderr
4982
+ // file descriptors are duplicated into the child process,
4983
+ // and during the short window between fork and exec, the
4984
+ // file descriptor is kept alive long enough for the
4985
+ // build to finish. It's a half-baked theory, but this
4986
+ // seems to prevent the spurious errors in CI.
4987
+ // An alternative solution is to run this test in
4988
+ // a single-threaded environment.
4989
+ for i in 0..100000 {
4979
4990
if use_stderr {
4980
- eprintln!("{}", i);
4991
+ eprintln!("0123456789 {}", i);
4981
4992
} else {
4982
- println!("{}", i);
4993
+ println!("0123456789 {}", i);
4983
4994
}
4984
4995
}
4985
4996
TokenStream::new()
You can’t perform that action at this time.
0 commit comments