Skip to content

Commit fe96ef3

Browse files
kalyazinroypat
authored andcommitted
test(conftest): dump VM metrics on test failure
This is to have latest VM metrics available when analysing failures. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
1 parent 3c3233c commit fe96ef3

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
@@ -339,6 +339,11 @@ def microvm_factory(request, record_property, results_dir, netns_factory):
339339
report = request.node.stash[PHASE_REPORT_KEY]
340340
if "call" in report and report["call"].failed:
341341
for uvm in uvm_factory.vms:
342+
# This is best effort. We want to proceed even if the VM is not responding.
343+
try:
344+
uvm.flush_metrics()
345+
except: # pylint: disable=bare-except
346+
pass
342347
uvm_data = results_dir / uvm.id
343348
uvm_data.mkdir()
344349
uvm_data.joinpath("host-dmesg.log").write_text(

0 commit comments

Comments
 (0)