Skip to content

Commit 0456bf2

Browse files
committed
test: take snapshot on failure
If a test fails, take a snapshot fo the microvms involved, and upload it as a CI artifact, for post-mortem analysis. Signed-off-by: Patrick Roy <[email protected]>
1 parent cbee3a3 commit 0456bf2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,14 @@ def microvm_factory(request, record_property, results_dir, netns_factory):
378378
uvm.flush_metrics()
379379
except: # pylint: disable=bare-except
380380
pass
381+
382+
try:
383+
uvm.snapshot_full(
384+
mem_path="post_failure.mem", vmstate_path="post_failure.vmstate"
385+
)
386+
except: # pylint: disable=bare-except
387+
pass
388+
381389
uvm_data = results_dir / uvm.id
382390
uvm_data.mkdir()
383391
uvm_data.joinpath("host-dmesg.log").write_text(

0 commit comments

Comments
 (0)