Skip to content

Commit acb1153

Browse files
committed
Merge #10659: [qa] blockchain: Pass on closed connection during generate call
fab1fb7 [qa] blockchain: Pass on closed connection during generate call (MarcoFalke) Tree-SHA512: 754be08675c3aca6f8003dc4bc68336e3693609ec14afc91cec592603aabe515f82534ef7b3db469792458ae4c70d5eae0ea0e8abd0ea338e22351aa01173046
2 parents ac52492 + fab1fb7 commit acb1153

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/functional/blockchain.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919

2020
from decimal import Decimal
21+
import http.client
2122
import subprocess
2223

2324
from test_framework.test_framework import BitcoinTestFramework
@@ -28,6 +29,7 @@
2829
assert_is_hex_string,
2930
assert_is_hash_string,
3031
bitcoind_processes,
32+
BITCOIND_PROC_WAIT_TIMEOUT,
3133
)
3234

3335

@@ -140,9 +142,12 @@ def _test_stopatheight(self):
140142
assert_equal(self.nodes[0].getblockcount(), 206)
141143
self.log.debug('Node should not stop at this height')
142144
assert_raises(subprocess.TimeoutExpired, lambda: bitcoind_processes[0].wait(timeout=3))
143-
self.nodes[0].generate(1)
145+
try:
146+
self.nodes[0].generate(1)
147+
except (ConnectionError, http.client.BadStatusLine):
148+
pass # The node already shut down before response
144149
self.log.debug('Node should stop at this height...')
145-
bitcoind_processes[0].wait(timeout=3)
150+
bitcoind_processes[0].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT)
146151
self.nodes[0] = self.start_node(0, self.options.tmpdir)
147152
assert_equal(self.nodes[0].getblockcount(), 207)
148153

0 commit comments

Comments
 (0)