From 4d36ecef9e86ee37293d4f4338e971d5f4f43427 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 22 Jun 2021 10:37:20 +0200 Subject: [PATCH] tests: Fix virtio_balloon integration test The virtio_balloon test is a bit flaky since we can't really know how much the balloon is gonna be deflated when the guest is under memory pressure. That's why it's safer to simply check that the balloon is not the initial size anymore. One small detail, but we don't need to check for the balloon size to be higher than 0 since the returned value is a u64. Signed-off-by: Sebastien Boeuf --- tests/integration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index 7302c62fe..978e9b0a2 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -4385,8 +4385,8 @@ mod tests { "After deflating, balloon memory size is {} bytes", deflated_balloon ); - // Verify the balloon size deflated by 10% at least - assert!(deflated_balloon > 0 && deflated_balloon < 1932735283); + // Verify the balloon size deflated + assert!(deflated_balloon < 2147483648); }); let _ = child.kill();