Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/integration_tests/functional/test_balloon.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ def test_deflate_on_oom(uvm_plain_any, deflate_on_oom):

# We get an initial reading of the RSS, then calculate the amount
# we need to inflate the balloon with by subtracting it from the
# VM size and adding an offset of 10 MiB in order to make sure we
# VM size and adding an offset of 50 MiB in order to make sure we
# get a lower reading than the initial one.
initial_rss = get_stable_rss_mem_by_pid(firecracker_pid)
inflate_size = 256 - int(initial_rss / 1024) + 10
inflate_size = 256 - (int(initial_rss / 1024) + 50)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changes the sign of the offset, meaning we are inflating 60MiB less rather than 40MiB more as the comment suggests. Or am I misreading?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah intended to be 60mb less now as I think we want to test if the balloon will deflate on the oom kiiler. So we allocate more memory now which will trigger the oom killer and check if the balloon behaves as we expect.

I think I'd read the comment wrong, I'd read it as its the initial memory usage + 10 (now 50) taken away from overall guest memory


# Inflate the balloon
test_microvm.api.balloon.patch(amount_mib=inflate_size)
Expand All @@ -213,7 +213,7 @@ def test_deflate_on_oom(uvm_plain_any, deflate_on_oom):
# Check that using memory leads to the balloon device automatically
# deflate (or not).
balloon_size_before = test_microvm.api.balloon_stats.get().json()["actual_mib"]
make_guest_dirty_memory(test_microvm.ssh, 64)
make_guest_dirty_memory(test_microvm.ssh, 128)

balloon_size_after = test_microvm.api.balloon_stats.get().json()["actual_mib"]
print(f"size before: {balloon_size_before} size after: {balloon_size_after}")
Expand Down
Loading