From 2d91659380dab96b2908b9354a6b06e20202d73f Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 23 Jan 2018 13:11:51 -0500 Subject: [PATCH] Try to make the async cmd check more stable --- ofborg/src/asynccmd.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ofborg/src/asynccmd.rs b/ofborg/src/asynccmd.rs index 0b50b69..f5213a0 100644 --- a/ofborg/src/asynccmd.rs +++ b/ofborg/src/asynccmd.rs @@ -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();