Skip to content

Commit

Permalink
Explicitly flush in tests that relied on linebuffering
Browse files Browse the repository at this point in the history
  • Loading branch information
tbu- committed Oct 6, 2019
1 parent fb48c55 commit 5279048
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/ui/command-pre-exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
extern crate libc;

use std::env;
use std::io::Error;
use std::io::{self, Error, Write};
use std::os::unix::process::CommandExt;
use std::process::Command;
use std::sync::atomic::{AtomicUsize, Ordering};
Expand All @@ -35,6 +35,7 @@ fn main() {
.arg("test1")
.pre_exec(|| {
println!("hello");
io::stdout().flush().unwrap();
Ok(())
})
.output()
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-30490.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ fn main() {

stdout().write_all("parent stdout\n".as_bytes()).expect("failed to write to stdout");
stderr().write_all("parent stderr\n".as_bytes()).expect("failed to write to stderr");
stdout().flush().expect("failed to flush stdout");

let child = {
Command::new(name)
Expand Down

0 comments on commit 5279048

Please sign in to comment.