summaryrefslogtreecommitdiffstats
path: root/tokio/tests/process_issue_2174.rs
diff options
context:
space:
mode:
authorIvan Petkov <ivanppetkov@gmail.com>2020-09-07 23:03:25 -0700
committerGitHub <noreply@github.com>2020-09-08 06:03:25 +0000
commit7c254eca446e56bbc41cbc309c2588f2d241f46a (patch)
tree35adb5343c4e67712efda40e60a4c3b538afe83e /tokio/tests/process_issue_2174.rs
parentf4d6ed03d9a4852f5222fd191143fe34725528a6 (diff)
process: make `Child::kill` async (#2823)
* This changes the `Child::kill` to be an async method which awaits the child after sending a kill signal. This avoids leaving zombie processes on Unix platforms if the caller forgets to await the child after the kill completes * A `start_kill` method was also added on `Child` which only sends the kill signal to the child process. This allows for kill signals to be sent even outside of async contexts.
Diffstat (limited to 'tokio/tests/process_issue_2174.rs')
-rw-r--r--tokio/tests/process_issue_2174.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/tokio/tests/process_issue_2174.rs b/tokio/tests/process_issue_2174.rs
index d12825f6..4493d54a 100644
--- a/tokio/tests/process_issue_2174.rs
+++ b/tokio/tests/process_issue_2174.rs
@@ -39,8 +39,7 @@ async fn issue_2174() {
time::delay_for(Duration::from_secs(1)).await;
// Kill the child process.
- child.kill().unwrap();
- let _ = child.wait().await;
+ child.kill().await.unwrap();
assert_err!(handle.await);
}