mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
Merge bitcoin/bitcoin#28253: test: display abrupt shutdown errors in console output
0f83ab407e
test: display abrupt shutdown errors in console output (furszy) Pull request description: 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). A bit of context: Currently, the test framework redirects each node's stderr output stream to a different temporary file inside each node's data directory. While this is sufficient for storing the error, it isn't very helpful for understanding what happened just by reading the CI console output. Most of the time, reading the stderr file in the CI environment is not possible, because people don't have access to it. Testing Note: The displayed error difference can be observed by cherry-picking this commit9cc5393c0f
on top of this branch and running any functional test. ACKs for top commit: maflcko: lgtm ACK0f83ab407e
theStack: ACK0f83ab407e
Tree-SHA512: 83ce4d21d5316e8cb16a17d3fbe77b8649fced9e09410861d9674c233f6e9c34bcf573504e387e4f439c2841b2ee9855d0d35607fa13aa89eafe0080c45ee82d
This commit is contained in:
commit
1472df63f7
1 changed files with 6 additions and 1 deletions
|
@ -234,8 +234,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