Skip to content

Commit 406ddd3

Browse files
committed
test: run all parametrized snapshot tests with mincore snapshots
Now that the test framework correctly differentiates between the need for rebase and the need for dirty page tracking, start running tests with mincore snapshots. Signed-off-by: Patrick Roy <[email protected]>
1 parent 2622baa commit 406ddd3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,9 @@ def io_engine(request):
427427
return request.param
428428

429429

430-
@pytest.fixture(params=[SnapshotType.DIFF, SnapshotType.FULL])
430+
@pytest.fixture(
431+
params=[SnapshotType.DIFF, SnapshotType.DIFF_MINCORE, SnapshotType.FULL]
432+
)
431433
def snapshot_type(request):
432434
"""All possible snapshot types"""
433435
return request.param

tests/framework/microvm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class SnapshotType(Enum):
5151

5252
FULL = auto()
5353
DIFF = auto()
54+
DIFF_MINCORE = auto()
5455

5556
def __repr__(self):
5657
cls_name = self.__class__.__name__
@@ -59,7 +60,7 @@ def __repr__(self):
5960
@property
6061
def needs_rebase(self) -> bool:
6162
"""Does this snapshot type need rebasing on top of a base snapshot before restoration?"""
62-
return self == SnapshotType.DIFF
63+
return self in [SnapshotType.DIFF, SnapshotType.DIFF_MINCORE]
6364

6465
@property
6566
def needs_dirty_page_tracking(self) -> bool:
@@ -72,7 +73,7 @@ def api_type(self) -> str:
7273
match self:
7374
case SnapshotType.FULL:
7475
return "Full"
75-
case SnapshotType.DIFF:
76+
case SnapshotType.DIFF | SnapshotType.DIFF_MINCORE:
7677
return "Diff"
7778

7879

tests/integration_tests/performance/test_snapshot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def test_snapshot_create_latency(
284284
match snapshot_type:
285285
case SnapshotType.FULL:
286286
metric = "full_create_snapshot"
287-
case SnapshotType.DIFF:
287+
case SnapshotType.DIFF | SnapshotType.DIFF_MINCORE:
288288
metric = "diff_create_snapshot"
289289

290290
for _ in range(ITERATIONS):

0 commit comments

Comments
 (0)