Skip to content

Commit c4a9ea9

Browse files
ShadowCurseroypat
authored andcommitted
refactor(tests): rename test_5_snapshots and reduce the number of cycles
Rename test to `test_cycled_snapshot_restore` and add a better comment to better explain what the test does. Also reduce number of cycles to 3 to speed test a bit. Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent 5598322 commit c4a9ea9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/integration_tests/functional/test_snapshot_basic.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def test_snapshot_current_version(uvm_nano):
113113
# TODO: Multiple microvm sizes must be tested in the async pipeline.
114114
@pytest.mark.parametrize("snapshot_type", [SnapshotType.DIFF, SnapshotType.FULL])
115115
@pytest.mark.parametrize("use_snapshot_editor", [False, True])
116-
def test_5_snapshots(
116+
def test_cycled_snapshot_restore(
117117
bin_vsock_path,
118118
tmp_path,
119119
microvm_factory,
@@ -124,10 +124,14 @@ def test_5_snapshots(
124124
cpu_template_any,
125125
):
126126
"""
127-
Create and load 5 snapshots.
127+
Run a cycle of VM restoration and VM snapshot creation where new VM is
128+
restored from a snapshot of the previous one.
128129
"""
130+
# This is an arbitrary selected value. It is big enough to test the
131+
# functionality, but small enough to not be annoying long to run.
132+
cycles = 3
133+
129134
logger = logging.getLogger("snapshot_sequence")
130-
seq_len = 5
131135
diff_snapshots = snapshot_type == SnapshotType.DIFF
132136

133137
vm = microvm_factory.build(guest_kernel, rootfs)
@@ -155,7 +159,7 @@ def test_5_snapshots(
155159
vm.kill()
156160

157161
for microvm in microvm_factory.build_n_from_snapshot(
158-
snapshot, seq_len, incremental=True, use_snapshot_editor=use_snapshot_editor
162+
snapshot, cycles, incremental=True, use_snapshot_editor=use_snapshot_editor
159163
):
160164
# FIXME: This and the sleep below reduce the rate of vsock/ssh connection
161165
# related spurious test failures, although we do not know why this is the case.

0 commit comments

Comments
 (0)