diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/common/relay.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/common/relay.rs b/tests/common/relay.rs index 4208278..79b1c2a 100644 --- a/tests/common/relay.rs +++ b/tests/common/relay.rs | |||
| @@ -112,15 +112,8 @@ impl TestRelay { | |||
| 112 | 112 | ||
| 113 | /// Stop the relay | 113 | /// Stop the relay |
| 114 | pub async fn stop(mut self) { | 114 | pub async fn stop(mut self) { |
| 115 | // Send SIGTERM to gracefully shutdown | 115 | // Kill the process (gracefully if possible) |
| 116 | #[cfg(unix)] | 116 | let _ = self.process.kill(); |
| 117 | { | ||
| 118 | use nix::sys::signal::{kill, Signal}; | ||
| 119 | use nix::unistd::Pid; | ||
| 120 | |||
| 121 | let pid = Pid::from_raw(self.process.id() as i32); | ||
| 122 | let _ = kill(pid, Signal::SIGTERM); | ||
| 123 | } | ||
| 124 | 117 | ||
| 125 | // Wait a bit for graceful shutdown | 118 | // Wait a bit for graceful shutdown |
| 126 | sleep(Duration::from_millis(100)).await; | 119 | sleep(Duration::from_millis(100)).await; |