mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-26 15:51:13 +02:00
test: Properly raise FailedToStartError when rpc shutdown before warmup finished (take 2)
This commit is contained in:
@@ -225,9 +225,6 @@ class TestNode():
|
|||||||
self.rpc_connected = True
|
self.rpc_connected = True
|
||||||
self.url = self.rpc.url
|
self.url = self.rpc.url
|
||||||
return
|
return
|
||||||
except IOError as e:
|
|
||||||
if e.errno != errno.ECONNREFUSED: # Port not yet open?
|
|
||||||
raise # unknown IO error
|
|
||||||
except JSONRPCException as e: # Initialization phase
|
except JSONRPCException as e: # Initialization phase
|
||||||
# -28 RPC in warmup
|
# -28 RPC in warmup
|
||||||
# -342 Service unavailable, RPC server started but is shutting down due to error
|
# -342 Service unavailable, RPC server started but is shutting down due to error
|
||||||
@@ -237,6 +234,9 @@ class TestNode():
|
|||||||
# This might happen when the RPC server is in warmup, but shut down before the call to getblockcount
|
# 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
|
# succeeds. Try again to properly raise the FailedToStartError
|
||||||
pass
|
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
|
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting
|
||||||
if "No RPC credentials" not in str(e):
|
if "No RPC credentials" not in str(e):
|
||||||
raise
|
raise
|
||||||
|
Reference in New Issue
Block a user