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
This commit is contained in:
parent
c0e767b00b
commit
13a8fcd3e9
1 changed files with 5 additions and 2 deletions
|
@ -814,7 +814,10 @@ mod tests {
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn sleeper() -> Process {
|
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() {
|
iotest!(fn test_kill() {
|
||||||
|
@ -828,5 +831,5 @@ mod tests {
|
||||||
assert!(Process::kill(p.id(), 0).is_ok());
|
assert!(Process::kill(p.id(), 0).is_ok());
|
||||||
p.signal_kill().unwrap();
|
p.signal_kill().unwrap();
|
||||||
assert!(!p.wait().success());
|
assert!(!p.wait().success());
|
||||||
} #[ignore(cfg(windows))]) // FIXME(#12516)
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue