aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-06-23 09:17:18 +0200
committerMarcoFalke <falke.marco@gmail.com>2017-06-23 09:17:13 +0200
commitfab1fb737b826c01fca4c10f3416cd84a8eca970 (patch)
tree918536775103e3b414e612ce294d667f8e39feba /test
parentc68a9a69278aa194fed96bd9733d32af3690a11e (diff)
downloadbitcoin-fab1fb737b826c01fca4c10f3416cd84a8eca970.tar.xz
[qa] blockchain: Pass on closed connection during generate call
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/blockchain.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/functional/blockchain.py b/test/functional/blockchain.py
index e205c6400c..eeef05efd2 100755
--- a/test/functional/blockchain.py
+++ b/test/functional/blockchain.py
@@ -18,6 +18,7 @@ Tests correspond to code in rpc/blockchain.cpp.
"""
from decimal import Decimal
+import http.client
import subprocess
from test_framework.test_framework import BitcoinTestFramework
@@ -28,6 +29,7 @@ from test_framework.util import (
assert_is_hex_string,
assert_is_hash_string,
bitcoind_processes,
+ BITCOIND_PROC_WAIT_TIMEOUT,
)
@@ -140,9 +142,12 @@ class BlockchainTest(BitcoinTestFramework):
assert_equal(self.nodes[0].getblockcount(), 206)
self.log.debug('Node should not stop at this height')
assert_raises(subprocess.TimeoutExpired, lambda: bitcoind_processes[0].wait(timeout=3))
- self.nodes[0].generate(1)
+ try:
+ self.nodes[0].generate(1)
+ except (ConnectionError, http.client.BadStatusLine):
+ pass # The node already shut down before response
self.log.debug('Node should stop at this height...')
- bitcoind_processes[0].wait(timeout=3)
+ bitcoind_processes[0].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT)
self.nodes[0] = self.start_node(0, self.options.tmpdir)
assert_equal(self.nodes[0].getblockcount(), 207)