aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-05-21 17:26:45 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-05-21 17:27:27 +0200
commit99e5e21b38bc0a5b26a53b84b5435b7abd1a7803 (patch)
tree4482eab3007f4e31799fd228d9a979450747bc64 /test
parent741816936441210e7f7e4bcf00300d83aa950481 (diff)
parentfab908f18a080912a0e833f12cccc27f27662e3b (diff)
downloadbitcoin-99e5e21b38bc0a5b26a53b84b5435b7abd1a7803.tar.xz
Merge #19023: test: Fix intermittent ETIMEDOUT on FreeBSD
fab908f18a080912a0e833f12cccc27f27662e3b test: Fix intermittent ETIMEDOUT on FreeBSD (MarcoFalke) Pull request description: Example backtrace: https://cirrus-ci.com/task/5307019047469056?command=functional_test#L1059 ACKs for top commit: laanwj: ACK fab908f18a080912a0e833f12cccc27f27662e3b Tree-SHA512: 06e383e9993e083d6da4c546dde8811ace02559ddbb1c24e307938307763b3abe630699054e7067cf4aea993c82865e259b77b4bee518666a03d26e0f81c0656
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/test_framework/test_node.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index d52aff6f7e..ebc0501e11 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -219,7 +219,12 @@ class TestNode():
raise FailedToStartError(self._node_msg(
'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
try:
- rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.chain, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir)
+ rpc = get_rpc_proxy(
+ rpc_url(self.datadir, self.index, self.chain, self.rpchost),
+ self.index,
+ timeout=self.rpc_timeout // 2, # Shorter timeout to allow for one retry in case of ETIMEDOUT
+ coveragedir=self.coverage_dir,
+ )
rpc.getblockcount()
# If the call to getblockcount() succeeds then the RPC connection is up
if self.version_is_at_least(190000):
@@ -260,7 +265,11 @@ class TestNode():
# succeeds. Try again to properly raise the FailedToStartError
pass
except OSError as e:
- if e.errno != errno.ECONNREFUSED: # Port not yet open?
+ if e.errno == errno.ETIMEDOUT:
+ pass # Treat identical to ConnectionResetError
+ elif e.errno == errno.ECONNREFUSED:
+ pass # Port not yet open?
+ else:
raise # unknown OS error
except ValueError as e: # cookie file not found and no rpcuser or rpcpassword; bitcoind is still starting
if "No RPC credentials" not in str(e):