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.
This commit is contained in:
1 file changed
+3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user