mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
The post-migration check used a fixed `thread::sleep(3s)` followed by `try_wait()` to verify the source VM had exited cleanly. That window is too tight when the source process is the release binary used by `test_live_upgrade_*` (i.e. `~/workloads/cloud-hypervisor-static`, pinned to `migratable_version`). The released binary is older than the locally-built destination and its virtio-device teardown (resume-paused-thread -> kill -> join across pmem, block, net, console, rng workers) regularly takes longer than 3s on contended hosts, causing the test to report: thread 'common_parallel::test_live_upgrade_basic' panicked: Test failed: source VM was not terminated successfully. even though the source process eventually exits with status 0. Replace the fixed sleep with a `wait_until(Duration::from_secs(30), ...)` poll that returns as soon as `try_wait()` reports a reaped child, then keep the existing `success()` check on the exit status. This makes the assertion robust against the slower release-binary shutdown path while still failing fast on a genuine error. The same pattern was duplicated across eight migration helpers plus the virtio-fs migration variant; convert all nine call sites for consistency. Signed-off-by: Muminul Islam <muislam@microsoft.com>