Skip to content

Commit 1f3d78b

Browse files
committed
Wait for connection to open in bip9-softforks.py
bip9-sofforks.py stop-starts the bitcoind node twice during the test run, but it doesn't wait for the connection from mininode to open before continuing with the test. This leads to race conditions where the test can fail getblocktemplate() because it has no p2p connections.
1 parent 0b9fb68 commit 1f3d78b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/functional/bip9-softforks.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,14 @@ def test_BIP(self, bipName, activated_version, invalidate, invalidatePostSignatu
200200
yield TestInstance([[block, False]])
201201

202202
# Restart all
203-
self.test.block_store.close()
203+
self.test.clear_all_connections()
204204
stop_nodes(self.nodes)
205-
shutil.rmtree(self.options.tmpdir)
205+
shutil.rmtree(self.options.tmpdir + "/node0")
206206
self.setup_chain()
207207
self.setup_network()
208-
self.test.block_store = BlockStore(self.options.tmpdir)
209-
self.test.clear_all_connections()
210208
self.test.add_all_connections(self.nodes)
211-
NetworkThread().start() # Start up network handling in another thread
212-
209+
NetworkThread().start()
210+
self.test.test_nodes[0].wait_for_verack()
213211

214212
def get_tests(self):
215213
for test in itertools.chain(

0 commit comments

Comments
 (0)