Skip to content

Commit a42683b

Browse files
committed
fix(test): disable memory monitor in cross-kernel snapshot restore test
MemoryMonitor's is_guest_mem heuristic matches a single guest-sized VMA, but _test_balloon inflates the balloon after restore, and GuestRegionMmapExt::discard_range overlays MAP_FIXED anonymous mmaps on the reclaimed ranges (a workaround specific to private file-backed mappings from snapshot restore). This fragments the 512 MiB guest VMA into ~190 smaller ones, none of which match the heuristic, and their RSS (~336 MiB) is counted as VMM overhead. This is the only cross-kernel test that inflates the balloon post- restore, and its purpose is validating cross-kernel compatibility, not VMM memory overhead, so the monitor is skipped here as it already is in test_snapshot_phase1. Signed-off-by: Jack Thomson <jackabt@amazon.com>
1 parent 03deaec commit a42683b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ def test_snap_restore_from_artifacts(
115115
# in the snapshot root dir.
116116
logger.info("Working with snapshot artifacts in %s.", snapshot_dir)
117117

118-
vm = microvm_factory.build()
118+
# Skip memory monitor: the balloon inflation below fragments the guest
119+
# VMA via discard_range's MAP_FIXED anonymous mmap workaround (used only
120+
# for private file-backed mappings from snapshot restore), defeating
121+
# MemoryMonitor.is_guest_mem. Cross-kernel test, not overhead.
122+
vm = microvm_factory.build(monitor_memory=False)
119123
vm.time_api_requests = False
120124
vm.spawn()
121125
logger.info("Loading microVM from snapshot...")

0 commit comments

Comments
 (0)