mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: Remove explicit sleeps from pvpanic test
Instead wait for the event to be delivered that it has panicked. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -3165,17 +3165,14 @@ pub(crate) fn _test_pvpanic(guest: &Guest) {
|
|||||||
// Trigger guest a panic
|
// Trigger guest a panic
|
||||||
make_guest_panic(guest);
|
make_guest_panic(guest);
|
||||||
|
|
||||||
// Wait a while for guest
|
// Wait for the panic event to be recorded
|
||||||
thread::sleep(std::time::Duration::new(10, 0));
|
|
||||||
|
|
||||||
let expected_sequential_events = [&MetaEvent {
|
let expected_sequential_events = [&MetaEvent {
|
||||||
event: "panic".to_string(),
|
event: "panic".to_string(),
|
||||||
device_id: None,
|
device_id: None,
|
||||||
}];
|
}];
|
||||||
assert!(check_latest_events_exact(
|
assert!(wait_until(Duration::from_secs(10), || {
|
||||||
&expected_sequential_events,
|
check_latest_events_exact(&expected_sequential_events, &event_path)
|
||||||
&event_path
|
}));
|
||||||
));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
kill_child(&mut child);
|
kill_child(&mut child);
|
||||||
|
|||||||
Reference in New Issue
Block a user