tests: Stabilize VFIO NVIDIA memory hotplug check

Bump the wait_until timeout for the guest-visible memory growth in
test_nvidia_card_memory_hotplug from 5s to 15s. The hot-add path inside
the guest kernel can take longer than 5s particularly when using
virtio-mem, which has been a source of flakes for this test.

Drop the trailing assert!(guest.get_total_memory() > 5_760_000), as it
is redundant.

See: #8160

Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
Bo Chen
2026-05-13 19:19:40 +00:00
committed by Rob Bradford
parent 9ca5f63fe0
commit 3645d916f3

View File

@@ -10758,10 +10758,9 @@ mod vfio {
// Add RAM to the VM
let desired_ram = 6 << 30;
resize_command(&api_socket, None, Some(desired_ram), None, None);
assert!(wait_until(Duration::from_secs(5), || {
assert!(wait_until(Duration::from_secs(15), || {
guest.get_total_memory().unwrap_or_default() > 5_760_000
}));
assert!(guest.get_total_memory().unwrap_or_default() > 5_760_000);
// Check the VFIO device works when RAM is increased to 6GiB.
// After guest memory hotplug, the VMM must refresh VFIO/iommufd DMA