Skip to content

Commit 0f83ab4

Browse files
committed
test: display abrupt shutdown errors in console output
Making it easier to debug errors in the CI environment, particularly in scenarios where it's not immediately clear what happened nor which node crashed (or shutdown abruptly).
1 parent b2ec032 commit 0f83ab4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/functional/test_framework/test_node.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,13 @@ def wait_for_rpc_connection(self):
232232
poll_per_s = 4
233233
for _ in range(poll_per_s * self.rpc_timeout):
234234
if self.process.poll() is not None:
235+
# Attach abrupt shutdown error/s to the exception message
236+
self.stderr.seek(0)
237+
str_error = ''.join(line.decode('utf-8') for line in self.stderr)
238+
str_error += "************************\n" if str_error else ''
239+
235240
raise FailedToStartError(self._node_msg(
236-
'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
241+
f'bitcoind exited with status {self.process.returncode} during initialization. {str_error}'))
237242
try:
238243
rpc = get_rpc_proxy(
239244
rpc_url(self.datadir, self.index, self.chain, self.rpchost),

0 commit comments

Comments
 (0)