SIGN IN SIGN UP

tests: balloon: synchronize RSS checks with resize completion

In rare cases, get_stable_rss_mem could report a stable RSS value before
the balloon has started to resize guest memory. This led to failures
where the balloon seemingly does nothing.

Wait for actual_mib to reach its target before sampling RSS. actual_mib
is a config space field the driver updates as it resizes, but the API
only exposes it through GET /balloon/statistics, which fails while
statistics are disabled, so enable statistics in the tests that read it.
Use a reachable fixed target with deflate_on_oom disabled in tests that
do not exercise OOM deflation. Double the default timeout of
wait_for_balloon_actual: it now guards 128 MiB resizes in every RSS
test, rather than only the 64 MiB ones in test_device_reset.

In test_stats, wait for a fresh statistics sample instead of a stable
RSS, and inflate by 64 MiB rather than 10 so that the change in free and
available memory stands out from the guest's own fluctuations.

Signed-off-by: James Curtis <jxcurtis@amazon.co.uk>
J
James Curtis committed
232aef5d1b70a248585528a14a007ff0304fe49c
Parent: a999faf