Skip to content

Commit 402d75a

Browse files
authored
Merge branch 'main' into restart-syscall-for-seccomp
2 parents 16cf8b7 + d1badbb commit 402d75a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tests/integration_tests/functional/test_balloon.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,20 @@ def test_deflate_on_oom(uvm_plain_any, deflate_on_oom):
207207
balloon_size_before = test_microvm.api.balloon_stats.get().json()["actual_mib"]
208208
make_guest_dirty_memory(test_microvm.ssh, 128)
209209

210-
balloon_size_after = test_microvm.api.balloon_stats.get().json()["actual_mib"]
211-
print(f"size before: {balloon_size_before} size after: {balloon_size_after}")
212-
if deflate_on_oom:
213-
assert balloon_size_after < balloon_size_before, "Balloon did not deflate"
210+
try:
211+
balloon_size_after = test_microvm.api.balloon_stats.get().json()["actual_mib"]
212+
except ConnectionError:
213+
assert (
214+
not deflate_on_oom
215+
), "Guest died even though it should have deflated balloon to alleviate memory pressure"
216+
217+
test_microvm.mark_killed()
214218
else:
215-
assert balloon_size_after >= balloon_size_before, "Balloon deflated"
219+
print(f"size before: {balloon_size_before} size after: {balloon_size_after}")
220+
if deflate_on_oom:
221+
assert balloon_size_after < balloon_size_before, "Balloon did not deflate"
222+
else:
223+
assert balloon_size_after >= balloon_size_before, "Balloon deflated"
216224

217225

218226
# pylint: disable=C0103

0 commit comments

Comments
 (0)