Skip to content

Commit 168f970

Browse files
authored
Merge branch 'main' into dependabot/cargo/firecracker-357d80639d
2 parents ac1e028 + 797faa8 commit 168f970

File tree

13 files changed

+39
-15
lines changed

13 files changed

+39
-15
lines changed

.buildkite/pipeline_perf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,41 @@
1818
perf_test = {
1919
"virtio-block-sync": {
2020
"label": "💿 Virtio Sync Block Performance",
21-
"tests": "integration_tests/performance/test_block_ab.py::test_block_performance -k 'not Async'",
21+
"tests": "integration_tests/performance/test_block.py::test_block_performance -k 'not Async'",
2222
"devtool_opts": "-c 1-10 -m 0",
2323
},
2424
"virtio-block-async": {
2525
"label": "💿 Virtio Async Block Performance",
26-
"tests": "integration_tests/performance/test_block_ab.py::test_block_performance -k Async",
26+
"tests": "integration_tests/performance/test_block.py::test_block_performance -k Async",
2727
"devtool_opts": "-c 1-10 -m 0",
2828
},
2929
"vhost-user-block": {
3030
"label": "💿 vhost-user Block Performance",
31-
"tests": "integration_tests/performance/test_block_ab.py::test_block_vhost_user_performance",
31+
"tests": "integration_tests/performance/test_block.py::test_block_vhost_user_performance",
3232
"devtool_opts": "-c 1-10 -m 0",
3333
"ab_opts": "--noise-threshold 0.1",
3434
},
3535
"network": {
3636
"label": "📠 Network Latency and Throughput",
37-
"tests": "integration_tests/performance/test_network_ab.py",
37+
"tests": "integration_tests/performance/test_network.py",
3838
"devtool_opts": "-c 1-10 -m 0",
3939
# Triggers if delta is > 0.01ms (10µs) or default relative threshold (5%)
4040
# only relevant for latency test, throughput test will always be magnitudes above this anyway
4141
"ab_opts": "--absolute-strength 0.010",
4242
},
4343
"snapshot-latency": {
4444
"label": "📸 Snapshot Latency",
45-
"tests": "integration_tests/performance/test_snapshot_ab.py::test_restore_latency integration_tests/performance/test_snapshot_ab.py::test_post_restore_latency",
45+
"tests": "integration_tests/performance/test_snapshot.py::test_restore_latency integration_tests/performance/test_snapshot.py::test_post_restore_latency integration_tests/performance/test_snapshot.py::test_snapshot_create_latency",
4646
"devtool_opts": "-c 1-12 -m 0",
4747
},
4848
"population-latency": {
4949
"label": "📸 Memory Population Latency",
50-
"tests": "integration_tests/performance/test_snapshot_ab.py::test_population_latency",
50+
"tests": "integration_tests/performance/test_snapshot.py::test_population_latency",
5151
"devtool_opts": "-c 1-12 -m 0",
5252
},
5353
"vsock-throughput": {
5454
"label": "🧦 Vsock Throughput",
55-
"tests": "integration_tests/performance/test_vsock_ab.py",
55+
"tests": "integration_tests/performance/test_vsock.py",
5656
"devtool_opts": "-c 1-10 -m 0",
5757
},
5858
"memory-overhead": {

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ BUILDKITE_PULL_REQUEST=true BUILDKITE_PULL_REQUEST_BASE_BRANCH=main ./tools/devt
162162
Firecracker has a special framework for orchestrating long-running A/B-tests
163163
which run outside the pre-PR CI. Instead, these tests are scheduled to run
164164
post-merge. Specific tests, such as our
165-
[snapshot restore latency tests](integration_tests/performance/test_snapshot_ab.py)
165+
[snapshot restore latency tests](integration_tests/performance/test_snapshot.py)
166166
contain no assertions themselves, but rather they emit data series using the
167167
`aws_embedded_metrics` library. When executed by the
168168
[`tools/ab_test.py`](../tools/ab_test.py) orchestration script, these data

tests/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from framework import defs, utils
3535
from framework.artifacts import disks, kernel_params
3636
from framework.defs import DEFAULT_BINARY_DIR
37-
from framework.microvm import MicroVMFactory
37+
from framework.microvm import MicroVMFactory, SnapshotType
3838
from framework.properties import global_props
3939
from framework.utils_cpu_templates import (
4040
custom_cpu_templates_params,
@@ -411,6 +411,12 @@ def io_engine(request):
411411
return request.param
412412

413413

414+
@pytest.fixture(params=[SnapshotType.DIFF, SnapshotType.FULL])
415+
def snapshot_type(request):
416+
"""All possible snapshot types"""
417+
return request.param
418+
419+
414420
@pytest.fixture
415421
def results_dir(request, pytestconfig):
416422
"""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0

tests/integration_tests/functional/test_snapshot_basic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def test_snapshot_current_version(uvm_nano):
111111
# - Rootfs: Ubuntu 18.04
112112
# - Microvm: 2vCPU with 512 MB RAM
113113
# TODO: Multiple microvm sizes must be tested in the async pipeline.
114-
@pytest.mark.parametrize("snapshot_type", [SnapshotType.DIFF, SnapshotType.FULL])
115114
@pytest.mark.parametrize("use_snapshot_editor", [False, True])
116115
def test_cycled_snapshot_restore(
117116
bin_vsock_path,
@@ -500,7 +499,6 @@ def test_snapshot_overwrite_self(guest_kernel, rootfs, microvm_factory):
500499
# restored, with a new snapshot of this vm, does not break the VM
501500

502501

503-
@pytest.mark.parametrize("snapshot_type", [SnapshotType.DIFF, SnapshotType.FULL])
504502
def test_vmgenid(guest_kernel_linux_6_1, rootfs, microvm_factory, snapshot_type):
505503
"""
506504
Test VMGenID device upon snapshot resume
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0

tests/integration_tests/performance/test_snapshot_ab.py renamed to tests/integration_tests/performance/test_snapshot.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212

1313
import host_tools.drive as drive_tools
14-
from framework.microvm import HugePagesConfig, Microvm
14+
from framework.microvm import HugePagesConfig, Microvm, SnapshotType
1515

1616
USEC_IN_MSEC = 1000
1717
NS_IN_MSEC = 1_000_000
@@ -251,26 +251,36 @@ def test_population_latency(
251251
raise RuntimeError("UFFD handler did not print population latency after 5s")
252252

253253

254+
@pytest.mark.nonci
254255
def test_snapshot_create_latency(
255256
microvm_factory,
256257
guest_kernel_linux_5_10,
257258
rootfs,
258259
metrics,
260+
snapshot_type,
259261
):
260262
"""Measure the latency of creating a Full snapshot"""
261263

262264
vm = microvm_factory.build(guest_kernel_linux_5_10, rootfs, monitor_memory=False)
263265
vm.spawn()
264-
vm.basic_config(vcpu_count=2, mem_size_mib=512)
266+
vm.basic_config(
267+
vcpu_count=2,
268+
mem_size_mib=512,
269+
track_dirty_pages=snapshot_type == SnapshotType.DIFF,
270+
)
265271
vm.start()
266272
vm.pin_threads(0)
267273

268274
metrics.set_dimensions(
269-
{**vm.dimensions, "performance_test": "test_snapshot_create_latency"}
275+
{
276+
**vm.dimensions,
277+
"performance_test": "test_snapshot_create_latency",
278+
"snapshot_type": snapshot_type.value,
279+
}
270280
)
271281

272282
for _ in range(ITERATIONS):
273-
vm.snapshot_full()
283+
vm.make_snapshot(snapshot_type)
274284
fc_metrics = vm.flush_metrics()
275285

276286
value = fc_metrics["latencies_us"]["full_create_snapshot"] / USEC_IN_MSEC

0 commit comments

Comments
 (0)