Skip to content

Commit 3e6a31c

Browse files
committed
refactor(test): merge two snapshot perf test files
Move the snapshot creation latency test into test_snapshot_ab.py. It won't be automatically A/B-tested (because pipeline_perf.py refers to specific test names inside this file), but technically it could be. No functional change intended. Doing this because I was getting annoyed at not being able to tab-complete `test_s` into `test_snapshot_ab`. Signed-off-by: Patrick Roy <[email protected]>
1 parent bf893b6 commit 3e6a31c

File tree

2 files changed

+26
-40
lines changed

2 files changed

+26
-40
lines changed

tests/integration_tests/performance/test_snapshot_ab.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,29 @@ def test_population_latency(
249249
break
250250
else:
251251
raise RuntimeError("UFFD handler did not print population latency after 5s")
252+
253+
254+
def test_snapshot_create_latency(
255+
microvm_factory,
256+
guest_kernel_linux_5_10,
257+
rootfs,
258+
metrics,
259+
):
260+
"""Measure the latency of creating a Full snapshot"""
261+
262+
vm = microvm_factory.build(guest_kernel_linux_5_10, rootfs, monitor_memory=False)
263+
vm.spawn()
264+
vm.basic_config(vcpu_count=2, mem_size_mib=512)
265+
vm.start()
266+
vm.pin_threads(0)
267+
268+
metrics.set_dimensions(
269+
{**vm.dimensions, "performance_test": "test_snapshot_create_latency"}
270+
)
271+
272+
for _ in range(ITERATIONS):
273+
vm.snapshot_full()
274+
fc_metrics = vm.flush_metrics()
275+
276+
value = fc_metrics["latencies_us"]["full_create_snapshot"] / USEC_IN_MSEC
277+
metrics.put_metric("latency", value, "Milliseconds")

tests/integration_tests/performance/test_snapshot_perf.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)