Skip to content

Commit affc880

Browse files
Alexandru-Cezar Sardandianpopa
authored andcommitted
tests/snap: make balloon checks more reliable
When checking the functionality of the balloon device, we use an application to fault in some memory inside the guest, then try to reclaim some memory back using the balloon. Make the balloon check function fault in and reclaim a more significant amount of memory such that the test does not get affected by other processes in the guest that are maybe using memory temporarily. Signed-off-by: Alexandru-Cezar Sardan <[email protected]>
1 parent 475aa52 commit affc880

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ def _test_balloon(microvm, ssh_connection):
3535

3636
# Check memory usage.
3737
first_reading = get_stable_rss_mem_by_pid(firecracker_pid)
38-
# Dirty 60MB of pages.
39-
make_guest_dirty_memory(ssh_connection, amount=(60 * MB_TO_PAGES))
38+
# Dirty 300MB of pages.
39+
make_guest_dirty_memory(ssh_connection, amount=(300 * MB_TO_PAGES))
4040
# Check memory usage again.
4141
second_reading = get_stable_rss_mem_by_pid(firecracker_pid)
4242
assert second_reading > first_reading
4343

44-
# Inflate the balloon.
45-
response = microvm.balloon.patch(amount_mib=40)
44+
# Inflate the balloon. Get back 200MB.
45+
response = microvm.balloon.patch(amount_mib=200)
4646
assert microvm.api_session.is_status_no_content(response.status_code)
4747

4848
third_reading = get_stable_rss_mem_by_pid(firecracker_pid)

0 commit comments

Comments
 (0)