Skip to content

Commit 8463aaa

Browse files
committed
[qa] Increase wallet-dump RPC timeout
Increase wallet-dump RPC timeout from 30 seconds to 1 minute. This avoids a timeout error that seemed to happen regularly (around 50% of builds) on a particular jenkins server during the first getnewaddress RPC call made by the test. The failing stack trace looked like: Unexpected exception caught during testing: timeout('timed out',) File ".../bitcoin/qa/rpc-tests/test_framework/test_framework.py", line 146, in main self.run_test() File ".../bitcoin/qa/rpc-tests/wallet-dump.py", line 73, in run_test addr = self.nodes[0].getnewaddress() File ".../bitcoin/qa/rpc-tests/test_framework/coverage.py", line 49, in __call__ return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs) File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 145, in __call__ response = self._request('POST', self.__url.path, postdata.encode('utf-8')) File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 121, in _request return self._get_response() File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 160, in _get_response http_response = self.__conn.getresponse() File "/usr/lib/python3.4/http/client.py", line 1171, in getresponse response.begin() File "/usr/lib/python3.4/http/client.py", line 351, in begin version, status, reason = self._read_status() File "/usr/lib/python3.4/http/client.py", line 313, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.4/socket.py", line 374, in readinto return self._sock.recv_into(b)
1 parent 273bde3 commit 8463aaa

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

qa/rpc-tests/test_framework/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
341341

342342
return proxy
343343

344-
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None):
344+
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, timewait=None, binary=None):
345345
"""
346346
Start multiple bitcoinds, return RPC connections to them
347347
"""
@@ -350,7 +350,7 @@ def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None):
350350
rpcs = []
351351
try:
352352
for i in range(num_nodes):
353-
rpcs.append(start_node(i, dirname, extra_args[i], rpchost, binary=binary[i]))
353+
rpcs.append(start_node(i, dirname, extra_args[i], rpchost, timewait=timewait, binary=binary[i]))
354354
except: # If one node failed to start, stop the others
355355
stop_nodes(rpcs)
356356
raise

qa/rpc-tests/wallet-dump.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def __init__(self):
6161
self.extra_args = [["-keypool=90"]]
6262

6363
def setup_network(self, split=False):
64-
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.extra_args)
64+
# Use 1 minute timeout because the initial getnewaddress RPC can take
65+
# longer than the default 30 seconds due to an expensive
66+
# CWallet::TopUpKeyPool call, and the encryptwallet RPC made later in
67+
# the test often takes even longer.
68+
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.extra_args, timewait=60)
6569

6670
def run_test (self):
6771
tmpdir = self.options.tmpdir

0 commit comments

Comments
 (0)