Skip to content

Commit 2c105b6

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 3a0a192 commit 2c105b6

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
@@ -117,7 +117,11 @@ def test_snap_restore_from_artifacts(
117117
# in the snapshot root dir.
118118
logger.info("Working with snapshot artifacts in %s.", snapshot_dir)
119119

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

0 commit comments

Comments
 (0)