mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: Ensure that virtiofsd has exited before hotplugging
Fix test flakiness where the virtiofsd daemon was still running and hotplugging was trying to reach the old version. Cleanup the socket so that waiting for it actually waits for the new instance. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -1060,6 +1060,11 @@ pub(crate) fn _test_virtio_fs(
|
||||
});
|
||||
|
||||
let (r, hotplug_daemon_child) = if r.is_ok() && hotplug {
|
||||
let _ = daemon_child.kill();
|
||||
let _ = daemon_child.wait();
|
||||
// Remove the stale socket so wait_for_virtiofsd_socket actually waits
|
||||
let _ = std::fs::remove_file(&virtiofsd_socket_path);
|
||||
|
||||
let (daemon_child, virtiofsd_socket_path) =
|
||||
prepare_daemon(&guest.tmp_dir, shared_dir.to_str().unwrap());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user