Skip to content

Commit fab46b3

Browse files
author
MarcoFalke
committed
test: Fix restart node race
1 parent f0913f2 commit fab46b3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,12 @@ def start_nodes(self, extra_args=None, *args, **kwargs):
517517
def stop_node(self, i, expected_stderr='', wait=0):
518518
"""Stop a bitcoind test node"""
519519
self.nodes[i].stop_node(expected_stderr, wait=wait)
520-
self.nodes[i].wait_until_stopped()
521520

522521
def stop_nodes(self, wait=0):
523522
"""Stop multiple bitcoind test nodes"""
524523
for node in self.nodes:
525524
# Issue RPC to stop nodes
526-
node.stop_node(wait=wait)
525+
node.stop_node(wait=wait, wait_until_stopped=False)
527526

528527
for node in self.nodes:
529528
# Wait for nodes to stop

test/functional/test_framework/test_node.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def get_wallet_rpc(self, wallet_name):
308308
def version_is_at_least(self, ver):
309309
return self.version is None or self.version >= ver
310310

311-
def stop_node(self, expected_stderr='', wait=0):
311+
def stop_node(self, expected_stderr='', *, wait=0, wait_until_stopped=True):
312312
"""Stop the node."""
313313
if not self.running:
314314
return
@@ -337,6 +337,9 @@ def stop_node(self, expected_stderr='', wait=0):
337337

338338
del self.p2ps[:]
339339

340+
if wait_until_stopped:
341+
self.wait_until_stopped()
342+
340343
def is_node_stopped(self):
341344
"""Checks whether the node has stopped.
342345

0 commit comments

Comments
 (0)