From 6354b4fd7fe819eb13274b212e426a7d10ca75d3 Mon Sep 17 00:00:00 2001 From: furszy Date: Tue, 27 Jan 2026 20:59:33 -0500 Subject: [PATCH] tests: log node JSON-RPC errors during test setup Currently, if the node replies to any command with an error during the test framework's setup(), we log the generic and not really useful "Unexpected exception" from the BaseException catch, with no further information. This isn't helpful for diagnosing the issue. Fix it by explicitly handling JSONRPCException and logging the response error message and http status code. --- test/functional/test_framework/test_framework.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 1f957564453..3ab351aef4a 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -147,6 +147,9 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): except subprocess.CalledProcessError as e: self.log.exception(f"Called Process failed with stdout='{e.stdout}'; stderr='{e.stderr}';") self.success = TestStatus.FAILED + except JSONRPCException as e: + self.log.exception(f"Failure during setup: error={e.error}, http_status={e.http_status}") + self.success = TestStatus.FAILED except BaseException: self.log.exception("Unexpected exception") self.success = TestStatus.FAILED