File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 18
18
"""
19
19
20
20
from decimal import Decimal
21
+ import http .client
21
22
import subprocess
22
23
23
24
from test_framework .test_framework import BitcoinTestFramework
28
29
assert_is_hex_string ,
29
30
assert_is_hash_string ,
30
31
bitcoind_processes ,
32
+ BITCOIND_PROC_WAIT_TIMEOUT ,
31
33
)
32
34
33
35
@@ -140,9 +142,12 @@ def _test_stopatheight(self):
140
142
assert_equal (self .nodes [0 ].getblockcount (), 206 )
141
143
self .log .debug ('Node should not stop at this height' )
142
144
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
144
149
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 )
146
151
self .nodes [0 ] = self .start_node (0 , self .options .tmpdir )
147
152
assert_equal (self .nodes [0 ].getblockcount (), 207 )
148
153
You can’t perform that action at this time.
0 commit comments