From 5ade9d46109c910a5b2e3ba2c77b1751867382a7 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 27 Feb 2020 13:57:33 +0000 Subject: [PATCH] tests: Remove unnecessary sleeps and kill on clean shutdown tests On tests that expect a clean shutdown there is no need to try and kill the child after wait() has returned as the process has already exited. Further there is no need to sleep before wait() as wait will block until the VM and VMM shutdown is complete. Signed-off-by: Rob Bradford --- tests/integration.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index 496742a4b..30e0960a8 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2398,13 +2398,10 @@ mod tests { .ssh_command("sudo shutdown -h now") .unwrap_or_default(); - thread::sleep(std::time::Duration::new(20, 0)); - // Check that the cloud-hypervisor binary actually terminated if let Ok(status) = child.wait() { aver_eq!(tb, status.success(), true); } - let _ = child.kill(); let _ = child.wait(); }); Ok(()) @@ -2460,7 +2457,6 @@ mod tests { if let Ok(status) = child.wait() { aver_eq!(tb, status.success(), true); } - let _ = child.kill(); let _ = child.wait(); Ok(()) });