From 13a8fcd3e9cfc49e8cc1d50d132188ded311f9db Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 24 Feb 2014 10:59:11 -0800 Subject: windows: Fix the test_exists unit test Turns out the `timeout` command was exiting immediately because it didn't like its output piped. Instead use `ping` repeatedly to get a process that will sleep for awhile. cc #12516 --- src/libstd/io/process.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index b8eaf3bc648..b782cf1d21a 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -814,7 +814,10 @@ mod tests { } #[cfg(windows)] pub fn sleeper() -> Process { - Process::new("timeout", [~"1000"]).unwrap() + // There's a `timeout` command on windows, but it doesn't like having + // its output piped, so instead just ping ourselves a few times with + // gaps inbetweeen so we're sure this process is alive for awhile + Process::new("ping", [~"127.0.0.1", ~"-n", ~"1000"]).unwrap() } iotest!(fn test_kill() { @@ -828,5 +831,5 @@ mod tests { assert!(Process::kill(p.id(), 0).is_ok()); p.signal_kill().unwrap(); assert!(!p.wait().success()); - } #[ignore(cfg(windows))]) // FIXME(#12516) + }) } -- cgit 1.4.1-3-g733a5