Skip to content

Commit

Permalink
save dmesg -T on the tear_down of blockstore loadtest
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Deb Natkh committed Jan 30, 2024
1 parent 9209c0f commit b0893bf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cloud/blockstore/tests/python/lib/loadtest_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import logging
import os
import subprocess


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -136,6 +137,19 @@ def tear_down(self):
d.handle.close()
os.unlink(d.path)

# It may be beneficial to save dmesg output for debugging purposes.
try:
dmesg_output = open("dmesg.txt", "w")
subprocess.run(
["sudo", "dmesg", "-T"],
stdout=dmesg_output,
stderr=dmesg_output,
timeout=10
)
except Exception as e:
logger.info(f"Failed to save dmesg output: {e}")
pass

@property
def endpoint(self):
return 'localhost:' + str(self.nbs.nbs_port)
Expand Down

0 comments on commit b0893bf

Please sign in to comment.