How do I clean up the status after the test process dies in the cargo test? If it's just a single test case, I can guarantee through Drop。I expected WarpDrop to call, but it didn't. (WarpDrop needs to exist in multiple testcases. If each case is regenerated, the cost is high.)
#[tokio::test]
async fn should_failure_when_without_xx1() {
}
#[tokio::test]
async fn should_failure_when_without_xx2() {
}
..
static INIT: Mutex<Option<WarpDrop>> = Mutex::new(None);
struct WarpDrop(Vec<Child>);
impl Drop for WarpDrop {
fn drop(&mut self) {
for chile in &mut self.0 {
let _ = chile.kill();
}
}
}