Skip to content

Commit

Permalink
test: Increase initial RPC timeout to 60 seconds
Browse files Browse the repository at this point in the history
When running the tests locally with a parallelism of 4 on an otherwise
busy system, RPC can take quite a wait to come up.

Change the timeout to 60 seconds just to be safe.

Github-Pull: #11091
Rebased-From: c1470a0
  • Loading branch information
laanwj authored and MarcoFalke committed Oct 3, 2017
1 parent fc2aa09 commit c276c1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def start(self):

def wait_for_rpc_connection(self):
"""Sets up an RPC connection to the bitcoind process. Returns False if unable to connect."""

# Wait for up to 10 seconds for the RPC server to respond
for _ in range(40):
timeout_s = 60 # Wait for up to 60 seconds for the RPC server to respond
poll_per_s = 4 # Poll at a rate of four times per second
for _ in range(timeout_s*poll_per_s):
assert not self.process.poll(), "bitcoind exited with status %i during initialization" % self.process.returncode
try:
self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, coveragedir=self.coverage_dir)
Expand All @@ -86,7 +86,7 @@ def wait_for_rpc_connection(self):
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
time.sleep(0.25)
time.sleep(1.0 / poll_per_s)
raise AssertionError("Unable to connect to bitcoind")

def get_wallet_rpc(self, wallet_name):
Expand Down

0 comments on commit c276c1e

Please sign in to comment.