Try to make the async cmd check more stable

This commit is contained in:
Graham Christensen 2018-01-23 13:11:51 -05:00
parent 67beebc680
commit 2d91659380
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C

View file

@ -189,13 +189,15 @@ mod tests {
#[test]
fn basic_interpolation_test() {
let mut cmd = Command::new("/bin/sh");
let mut cmd = Command::new("stdbuf");
cmd.arg("-o0");
cmd.arg("-e0");
cmd.arg("bash");
cmd.arg("-c");
// The sleep 0's are to introduce delay between output to help
// make it more predictably received in the right order
cmd.arg("echo stdout; sleep 0; echo stderr >&2; sleep 0; echo stdout2; sleep 0; echo stderr2 >&2");
cmd.arg("echo stdout; sleep 0.1; echo stderr >&2; sleep 0.1; echo stdout2; sleep 0.1; echo stderr2 >&2");
let acmd = AsyncCmd::new(cmd);
let mut spawned = acmd.spawn();