diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-02-07 10:15:25 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-02-07 10:15:41 -0500 |
commit | d83d6079432cf592ff6c740d1d3fbdb5e596facb (patch) | |
tree | 06dbe8f05c8fca652ee8b25bb33a77232fea19aa | |
parent | 72d34c0edc5ad9e69e0d054459ec15d2278f206b (diff) | |
parent | 6440e6137553a51480aad68f6048be4ffce7bfff (diff) |
Merge #15350: qa: Drop RPC connection if --usecli
6440e61375 qa: Drop RPC connection if --usecli (João Barbosa)
Pull request description:
Drop the RPC connection used in `TestNode.wait_for_rpc_connection` if `--usecli` is set. If the connection is kept and not used the `Connection: close` header is never sent and so the connection only closes due to timeout (30 sec).
It might be sensible to revert e98a9eede2fb48ff33a020acc888cbcd83e24bbf in a follow up, however it changes the shutdown behavior.
Tree-SHA512: 2a8ee68b82ab612a556390aae521379e592c39ea0a7855a119282e6fe4cbf02ecafe7a5e2ee37d480f2c0600fa64791117a80fecc7bbe6bbb354107972b3b320
-rwxr-xr-x | test/functional/test_framework/test_node.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index d6e31457d1..999ea68254 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -209,12 +209,15 @@ class TestNode(): raise FailedToStartError(self._node_msg( 'bitcoind exited with status {} during initialization'.format(self.process.returncode))) try: - self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir) - self.rpc.getblockcount() + rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir) + rpc.getblockcount() # If the call to getblockcount() succeeds then the RPC connection is up + self.log.debug("RPC successfully started") + if self.use_cli: + return + self.rpc = rpc self.rpc_connected = True self.url = self.rpc.url - self.log.debug("RPC successfully started") return except IOError as e: if e.errno != errno.ECONNREFUSED: # Port not yet open? |