From 4df994b5f0a48253f7967f0f1f9ce61a719348d0 Mon Sep 17 00:00:00 2001 From: Karolin Varner Date: Thu, 19 Dec 2024 16:13:58 +0100 Subject: [PATCH] fix: Coverage reporting in API integration tests --- rosenpass/tests/api-integration-tests.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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; + } + } } }