Skip to content

Commit c1470a0

Browse files
committed
test: Increase initial RPC timeout to 60 seconds
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.
1 parent 2621673 commit c1470a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/functional/test_framework/test_node.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def start(self):
6565

6666
def wait_for_rpc_connection(self):
6767
"""Sets up an RPC connection to the bitcoind process. Returns False if unable to connect."""
68-
69-
# Wait for up to 10 seconds for the RPC server to respond
70-
for _ in range(40):
68+
timeout_s = 60 # Wait for up to 60 seconds for the RPC server to respond
69+
poll_per_s = 4 # Poll at a rate of four times per second
70+
for _ in range(timeout_s*poll_per_s):
7171
assert not self.process.poll(), "bitcoind exited with status %i during initialization" % self.process.returncode
7272
try:
7373
self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, coveragedir=self.coverage_dir)
@@ -86,7 +86,7 @@ def wait_for_rpc_connection(self):
8686
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting
8787
if "No RPC credentials" not in str(e):
8888
raise
89-
time.sleep(0.25)
89+
time.sleep(1.0 / poll_per_s)
9090
raise AssertionError("Unable to connect to bitcoind")
9191

9292
def get_wallet_rpc(self, wallet_name):

0 commit comments

Comments
 (0)