tests: Allow closed http server in assert_start_raises_init_error

This commit is contained in:
Chun Kuan Lee 2018-10-06 13:42:11 +08:00
parent f504a1402a
commit 62c304ea48

View file

@ -187,7 +187,9 @@ class TestNode():
if e.errno != errno.ECONNREFUSED: # Port not yet open? if e.errno != errno.ECONNREFUSED: # Port not yet open?
raise # unknown IO error raise # unknown IO error
except JSONRPCException as e: # Initialization phase except JSONRPCException as e: # Initialization phase
if e.error['code'] != -28: # RPC in warmup? # -28 RPC in warmup
# -342 Service unavailable, RPC server started but is shutting down due to error
if e.error['code'] != -28 and e.error['code'] != -342:
raise # unknown JSON RPC exception raise # unknown JSON RPC exception
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):