diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-04 22:02:49 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-04 22:02:49 +0000 |
| commit | 0ab5b17d4714f5bc15d1323fa1f190dbde379db6 (patch) | |
| tree | 7a736fc4a385521cd9bffd6e68e9ddc33c8e11a0 /tests/common | |
| parent | a245a252c32e07546dc15e5ad266d463bc15db08 (diff) | |
fix: remove nix crate usage from test code
Replace nix::sys::signal usage with standard library process::kill().
This completes the removal of the unnecessary nix dev dependency.
All tests passing:
- NIP-01: 6 passed, 1 ignored
- NIP-34: 12 passed, 1 ignored
Diffstat (limited to 'tests/common')
| -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; |