Skip to content

Commit

Permalink
send sigterm
Browse files Browse the repository at this point in the history
  • Loading branch information
meowjesty committed Jul 22, 2024
1 parent f1e960f commit 4364275
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mirrord/layer/tests/issue864.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use std::{path::PathBuf, time::Duration};

use nix::{
sys::{signal, signal::Signal},
unistd::Pid,
};
use rstest::rstest;

mod common;
Expand All @@ -21,7 +25,7 @@ async fn test_issue854(
dylib_path: &PathBuf,
config_dir: &PathBuf,
) {
let (mut test_process, mut intproxy) = application
let (test_process, mut intproxy) = application
.start_process_with_layer_and_port(
dylib_path,
vec![
Expand Down Expand Up @@ -54,7 +58,12 @@ async fn test_issue854(
.send_connection_then_data(&prepare_request_body("GET", ""), application.get_app_port())
.await;

test_process.wait().await;
signal::kill(
Pid::from_raw(test_process.child.id().expect("Child must have pid!") as i32),
Signal::SIGTERM,
)
.expect("Process has been `SIGTERM`!");

test_process
.assert_stdout_contains("GET: Request completed")
.await;
Expand Down

0 comments on commit 4364275

Please sign in to comment.