mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-24 23:38:03 +01:00
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).
This commit is contained in:
parent
b2ec0326fd
commit
0f83ab407e
1 changed files with 6 additions and 1 deletions
|
@ -232,8 +232,13 @@ class TestNode():
|
|||
poll_per_s = 4
|
||||
for _ in range(poll_per_s * self.rpc_timeout):
|
||||
if self.process.poll() is not None:
|
||||
# Attach abrupt shutdown error/s to the exception message
|
||||
self.stderr.seek(0)
|
||||
str_error = ''.join(line.decode('utf-8') for line in self.stderr)
|
||||
str_error += "************************\n" if str_error else ''
|
||||
|
||||
raise FailedToStartError(self._node_msg(
|
||||
'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
|
||||
f'bitcoind exited with status {self.process.returncode} during initialization. {str_error}'))
|
||||
try:
|
||||
rpc = get_rpc_proxy(
|
||||
rpc_url(self.datadir, self.index, self.chain, self.rpchost),
|
||||
|
|
Loading…
Add table
Reference in a new issue