Skip to content

Commit

Permalink
test: Properly raise FailedToStartError when rpc shutdown before warm…
Browse files Browse the repository at this point in the history
…up finished (take 2)
  • Loading branch information
MarcoFalke committed Apr 18, 2020
1 parent 4702cad commit fa03713
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ def wait_for_rpc_connection(self):
self.rpc_connected = True
self.url = self.rpc.url
return
except IOError as e:
if e.errno != errno.ECONNREFUSED: # Port not yet open?
raise # unknown IO error
except JSONRPCException as e: # Initialization phase
# -28 RPC in warmup
# -342 Service unavailable, RPC server started but is shutting down due to error
Expand All @@ -237,6 +234,9 @@ def wait_for_rpc_connection(self):
# This might happen when the RPC server is in warmup, but shut down before the call to getblockcount
# succeeds. Try again to properly raise the FailedToStartError
pass
except OSError as e:
if e.errno != errno.ECONNREFUSED: # Port not yet open?
raise # unknown OS error
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting
if "No RPC credentials" not in str(e):
raise
Expand Down

0 comments on commit fa03713

Please sign in to comment.