mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
process: skip the process_kill_on_drop test if bash is not installed. (#4079)
This commit is contained in:
parent
98578a6f4a
commit
b67d46403f
@ -1,6 +1,7 @@
|
|||||||
#![cfg(all(unix, feature = "process"))]
|
#![cfg(all(unix, feature = "process"))]
|
||||||
#![warn(rust_2018_idioms)]
|
#![warn(rust_2018_idioms)]
|
||||||
|
|
||||||
|
use std::io::ErrorKind;
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tokio::io::AsyncReadExt;
|
use tokio::io::AsyncReadExt;
|
||||||
@ -24,11 +25,12 @@ async fn kill_on_drop() {
|
|||||||
",
|
",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let mut child = cmd
|
let e = cmd.kill_on_drop(true).stdout(Stdio::piped()).spawn();
|
||||||
.kill_on_drop(true)
|
if e.is_err() && e.as_ref().unwrap_err().kind() == ErrorKind::NotFound {
|
||||||
.stdout(Stdio::piped())
|
println!("bash not available; skipping test");
|
||||||
.spawn()
|
return;
|
||||||
.unwrap();
|
}
|
||||||
|
let mut child = e.unwrap();
|
||||||
|
|
||||||
sleep(Duration::from_secs(2)).await;
|
sleep(Duration::from_secs(2)).await;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user