Skip to content

Commit a724eb1

Browse files
committed
test(conftest): dump VM metrics on test failure
This is to have latest VM metrics available when analysing failures. Signed-off-by: Nikita Kalyazin <[email protected]>
1 parent 85a094f commit a724eb1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ def microvm_factory(request, record_property, results_dir, netns_factory):
337337
report = request.node.stash[PHASE_REPORT_KEY]
338338
if "call" in report and report["call"].failed:
339339
for uvm in uvm_factory.vms:
340+
# This is best effort. We want to proceed even if the VM is not responding.
341+
try:
342+
uvm.flush_metrics()
343+
except:
344+
pass
340345
uvm_data = results_dir / uvm.id
341346
uvm_data.mkdir()
342347
uvm_data.joinpath("host-dmesg.log").write_text(

0 commit comments

Comments
 (0)