Skip to content

Commit

Permalink
Merge bitcoin#14413: tests: Allow closed rpc handler in assert_start_…
Browse files Browse the repository at this point in the history
…raises_init_error

62c304e tests: Allow closed http server in assert_start_raises_init_error (Chun Kuan Lee)

Pull request description:

  The rpc handler may be unregistered when http server haven't been closed yet. So it may be allowable to get -342 `non-JSON HTTP response with \'%i %s\' from server` (503 Service Unavailable)

  See https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.2001. It shows "Rejecting request while shutting down" between "RPC stopped" and "Stopped HTTP server"

Tree-SHA512: e1f50ab9096cf23494ccc2850c01516c4a75f112c99108759157b22fce2011682a4b88216f206702f6a56e960182c00098053ad75f13aa0eafe27046adae63da
  • Loading branch information
MarcoFalke authored and panleone committed Mar 27, 2024
1 parent cb65d0a commit 05c30a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def wait_for_rpc_connection(self):
if e.errno != errno.ECONNREFUSED: # Port not yet open?
raise # unknown IO error
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
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. pivxd still starting
if "No RPC credentials" not in str(e):
Expand Down

0 comments on commit 05c30a8

Please sign in to comment.