mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
test: Properly raise FailedToStartError when rpc shutdown before warmup finished
This commit is contained in:
parent
1b151e3ffc
commit
faede1b293
1 changed files with 4 additions and 0 deletions
|
@ -233,6 +233,10 @@ class TestNode():
|
||||||
# -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
|
||||||
if e.error['code'] != -28 and e.error['code'] != -342:
|
if e.error['code'] != -28 and e.error['code'] != -342:
|
||||||
raise # unknown JSON RPC exception
|
raise # unknown JSON RPC exception
|
||||||
|
except ConnectionResetError:
|
||||||
|
# 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 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue