diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 6475f0de1f368..fced2a3862c09 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -610,13 +610,12 @@ def start_nodes(self, extra_args=None, *args, **kwargs): def stop_node(self, i, expected_stderr='', wait=0): """Stop a dashd test node""" self.nodes[i].stop_node(expected_stderr=expected_stderr, wait=wait) - self.nodes[i].wait_until_stopped() def stop_nodes(self, expected_stderr='', wait=0): """Stop multiple dashd test nodes""" for node in self.nodes: # Issue RPC to stop nodes - node.stop_node(expected_stderr=expected_stderr, wait=wait) + node.stop_node(expected_stderr=expected_stderr, wait=wait, wait_until_stopped=False) for node in self.nodes: # Wait for nodes to stop diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 26cc2a2bb1cc1..6391136b119ee 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -319,7 +319,7 @@ def get_wallet_rpc(self, wallet_name): def version_is_at_least(self, ver): return self.version is None or self.version >= ver - def stop_node(self, expected_stderr='', wait=0): + def stop_node(self, expected_stderr='', *, wait=0, wait_until_stopped=True): """Stop the node.""" if not self.running: return @@ -344,6 +344,9 @@ def stop_node(self, expected_stderr='', wait=0): del self.p2ps[:] + if wait_until_stopped: + self.wait_until_stopped() + def is_node_stopped(self): """Checks whether the node has stopped.