Skip to content

Commit

Permalink
NEBDUTY-504: save dmesg -T on the tear_down of blockstore loadtest (#309
Browse files Browse the repository at this point in the history
)

* save dmesg -T on the tear_down of blockstore loadtest

* save dmesg -T on the tear_down of blockstore loadtest

* save dmesg -T on the tear_down of blockstore loadtest

* save dmesg -T on the tear_down of blockstore loadtest

* wrap nbs/kikimr stop() in try block

* fix flake8...

---------

Co-authored-by: Maxim Deb Natkh <[email protected]>
  • Loading branch information
2 people authored and Maxim Deb Natkh committed Feb 5, 2024
1 parent 0d7f342 commit aa537a5
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 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 @@ -129,12 +130,26 @@ def __init__(
wait_for_nbs_server(self.nbs.nbs_port)

def tear_down(self):
self.nbs.stop()
self.kikimr_cluster.stop()

for d in self.__devices:
d.handle.close()
os.unlink(d.path)
try:
self.nbs.stop()
self.kikimr_cluster.stop()

for d in self.__devices:
d.handle.close()
os.unlink(d.path)
finally:
# It may be beneficial to save dmesg output for debugging purposes.
try:
with open(yatest_common.output_path() + "/dmesg.txt", "w") as dmesg_output:
subprocess.run(
["sudo", "dmesg", "-T"],
stdout=dmesg_output,
stderr=dmesg_output,
timeout=10
)
except Exception as dmesg_error:
logging.info(f"Failed to save dmesg output: {dmesg_error}")
pass

@property
def endpoint(self):
Expand Down

0 comments on commit aa537a5

Please sign in to comment.