Skip to content

Commit b690b24

Browse files
author
MarcoFalke
committed
Merge #18633: test: Properly raise FailedToStartError when rpc shutdown before warmup finished (take 2)
fa03713 test: Properly raise FailedToStartError when rpc shutdown before warmup finished (take 2) (MarcoFalke) Pull request description: actually (?) fix #18561 See most recent traceback https://travis-ci.org/github/bitcoin/bitcoin/jobs/674668692#L7062 I believe the reason the error is still there is that ConnectionResetError is derived from OSError: ConnectionResetError(ConnectionError(OSError)) And IOError is an alias for OSError since python 3.3, see https://docs.python.org/3/library/exceptions.html#IOError So fix that by renaming IOError to the alias OSError and move the less specific catch clause down a few lines. ACKs for top commit: jonatack: ACK fa03713 Tree-SHA512: 6e5b214ed9101bf8ebe7472dcc1f9e9d128e2575c93ec00c8d0774ae1a9b52a8c2a653a45a0eab8d881570b08dd5ffeddf5aca88a10438c366e1f633253cb0b5
2 parents d656311 + fa03713 commit b690b24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/functional/test_framework/test_node.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ def wait_for_rpc_connection(self):
225225
self.rpc_connected = True
226226
self.url = self.rpc.url
227227
return
228-
except IOError as e:
229-
if e.errno != errno.ECONNREFUSED: # Port not yet open?
230-
raise # unknown IO error
231228
except JSONRPCException as e: # Initialization phase
232229
# -28 RPC in warmup
233230
# -342 Service unavailable, RPC server started but is shutting down due to error
@@ -237,6 +234,9 @@ def wait_for_rpc_connection(self):
237234
# This might happen when the RPC server is in warmup, but shut down before the call to getblockcount
238235
# succeeds. Try again to properly raise the FailedToStartError
239236
pass
237+
except OSError as e:
238+
if e.errno != errno.ECONNREFUSED: # Port not yet open?
239+
raise # unknown OS error
240240
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting
241241
if "No RPC credentials" not in str(e):
242242
raise

0 commit comments

Comments
 (0)