Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip the process_kill_on_drop test if bash is not installed. #4079

Merged
merged 1 commit into from
Aug 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tokio/tests/process_kill_on_drop.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand Down