From 2c3a035a1f125e09454536308344d26f6e51e512 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Tue, 19 Feb 2019 06:58:04 +0100 Subject: [PATCH] Catch and print python exceptions when stopping nodes Otherwise the code at the bottom is never executed when nodes crash, leading to no output of debug.log files on Travis. --- qa/rpc-tests/test_framework/test_framework.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py index 5984b858263e08..b6f354f1387b43 100755 --- a/qa/rpc-tests/test_framework/test_framework.py +++ b/qa/rpc-tests/test_framework/test_framework.py @@ -175,7 +175,12 @@ def main(self): if not self.options.noshutdown: print("Stopping nodes") - stop_nodes(self.nodes) + try: + stop_nodes(self.nodes) + except BaseException as e: + success = False + print("Unexpected exception caught during shutdown: " + repr(e)) + traceback.print_tb(sys.exc_info()[2]) else: print("Note: dashds were not stopped and may still be running")