mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: Remove explicit sleep from tests_simple_launch tests
On the shutdown path remove the explicit sleep and instead wait for the event to be delivered. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -1604,7 +1604,6 @@ pub(crate) fn _test_simple_launch(guest: &Guest) {
|
||||
let _ = guest.ssh_command("sudo systemctl stop snapd");
|
||||
|
||||
guest.ssh_command("sudo poweroff").unwrap();
|
||||
thread::sleep(std::time::Duration::new(20, 0));
|
||||
let latest_events = [
|
||||
&MetaEvent {
|
||||
event: "shutdown".to_string(),
|
||||
@@ -1619,7 +1618,9 @@ pub(crate) fn _test_simple_launch(guest: &Guest) {
|
||||
device_id: None,
|
||||
},
|
||||
];
|
||||
assert!(check_latest_events_exact(&latest_events, &event_path));
|
||||
assert!(wait_until(Duration::from_secs(20), || {
|
||||
check_latest_events_exact(&latest_events, &event_path)
|
||||
}));
|
||||
});
|
||||
|
||||
kill_child(&mut child);
|
||||
|
||||
Reference in New Issue
Block a user