test: fix intermittent failure in wallet_reorgsrestore.py

Wait until the node's process has fully stopped before starting a new instance.

Since the same code is used in tool_wallet.py, this consolidates the behavior
into a 'kill_process()' function.
This commit is contained in:
furszy
2025-03-14 10:30:50 -04:00
parent 698f86964c
commit 36b0713edc
3 changed files with 7 additions and 5 deletions

View File

@ -443,6 +443,11 @@ class TestNode():
kwargs["expected_ret_code"] = 1 if expect_error else 0 # Whether node shutdown return EXIT_FAILURE or EXIT_SUCCESS
self.wait_until(lambda: self.is_node_stopped(**kwargs), timeout=timeout)
def kill_process(self):
self.process.kill()
self.wait_until_stopped(expected_ret_code=1 if platform.system() == "Windows" else -9)
assert self.is_node_stopped()
def replace_in_config(self, replacements):
"""
Perform replacements in the configuration file.