Skip to content

Commit 5279048

Browse files
committed
Explicitly flush in tests that relied on linebuffering
1 parent fb48c55 commit 5279048

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/test/ui/command-pre-exec.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
extern crate libc;
1111

1212
use std::env;
13-
use std::io::Error;
13+
use std::io::{self, Error, Write};
1414
use std::os::unix::process::CommandExt;
1515
use std::process::Command;
1616
use std::sync::atomic::{AtomicUsize, Ordering};
@@ -35,6 +35,7 @@ fn main() {
3535
.arg("test1")
3636
.pre_exec(|| {
3737
println!("hello");
38+
io::stdout().flush().unwrap();
3839
Ok(())
3940
})
4041
.output()

src/test/ui/issues/issue-30490.rs

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ fn main() {
5757

5858
stdout().write_all("parent stdout\n".as_bytes()).expect("failed to write to stdout");
5959
stderr().write_all("parent stderr\n".as_bytes()).expect("failed to write to stderr");
60+
stdout().flush().expect("failed to flush stdout");
6061

6162
let child = {
6263
Command::new(name)

0 commit comments

Comments
 (0)