diff --git a/rosenpass/tests/api-integration-tests.rs b/rosenpass/tests/api-integration-tests.rs index f5797da..e7e0259 100644 --- a/rosenpass/tests/api-integration-tests.rs +++ b/rosenpass/tests/api-integration-tests.rs @@ -22,8 +22,17 @@ struct KillChild(std::process::Child); impl Drop for KillChild { fn drop(&mut self) { - self.0.kill().discard_result(); - self.0.wait().discard_result() + use rustix::process::{kill_process, Pid, Signal::Term}; + let pid = Pid::from_child(&self.0); + // We seriously need to start handling signals with signalfd, our current signal handling + // system is a bit broken; there is probably a few functions that just restart on EINTR + // so the signal is absorbed + loop { + kill_process(pid, Term).discard_result(); + if self.0.try_wait().unwrap().is_some() { + break; + } + } } }