mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +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"))]
|
||||
#![warn(rust_2018_idioms)]
|
||||
|
||||
use std::io::ErrorKind;
|
||||
use std::process::Stdio;
|
||||
use std::time::Duration;
|
||||
use tokio::io::AsyncReadExt;
|
||||
@ -24,11 +25,12 @@ async fn kill_on_drop() {
|
||||
",
|
||||
]);
|
||||
|
||||
let mut child = cmd
|
||||
.kill_on_drop(true)
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
.unwrap();
|
||||
let e = cmd.kill_on_drop(true).stdout(Stdio::piped()).spawn();
|
||||
if e.is_err() && e.as_ref().unwrap_err().kind() == ErrorKind::NotFound {
|
||||
println!("bash not available; skipping test");
|
||||
return;
|
||||
}
|
||||
let mut child = e.unwrap();
|
||||
|
||||
sleep(Duration::from_secs(2)).await;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user