about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-02-24 10:59:11 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-02-24 12:33:06 -0800
commit13a8fcd3e9cfc49e8cc1d50d132188ded311f9db (patch)
tree474472bd05e4e9570c3b008768939407c247ffa8 /src/libstd
parentc0e767b00b325576b4d09b624a47382133db6163 (diff)
downloadrust-13a8fcd3e9cfc49e8cc1d50d132188ded311f9db.tar.gz
rust-13a8fcd3e9cfc49e8cc1d50d132188ded311f9db.zip
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
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/process.rs7
1 files changed, 5 insertions, 2 deletions
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)
+    })
 }