From ec27e0ee82de0a6ab50c289341542ab48ddd6644 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Thu, 21 Jul 2022 11:16:55 +0200 Subject: [PATCH] tests: Fix test_virtio_balloon_deflate_on_oom() It might sometimes take a few seconds for the guest to trigger the OOM and report it back to the host. That's why this patch adds some sleep time between the command in the guest supposedly triggering the OOM and the check of the balloon size from the host. Fixes #4336 Signed-off-by: Sebastien Boeuf --- tests/integration.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index 4215335ab..7b04cc234 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -5069,6 +5069,10 @@ mod parallel { .ssh_command("stress --vm 25 --vm-keep --vm-bytes 1G --timeout 20") .unwrap(); + // Give some time for the OOM to happen in the guest and be reported + // back to the host. + thread::sleep(std::time::Duration::new(20, 0)); + // 2nd: check balloon_mem's value to verify balloon has been automatically deflated let deflated_balloon = balloon_size(&api_socket); println!(