From faf2f2c654d9aa18b2f49a157956f9ab0fce302a Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 23 Jan 2025 14:39:59 +0100 Subject: [PATCH] test: Avoid redundant stop and error spam on shutdown Trying to shut down a node after a test failure may fail and lead to an RPC error. Also, it is confusing to sidestep the existing fallback to kill any leftover nodes on a test failure. So just rely on the fallback. Idea by Hodlinator. Co-Authored-By: Hodlinator <172445034+hodlinator@users.noreply.github.com> --- test/functional/test_framework/test_framework.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index e437bde76bb..f77e03dd225 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -323,9 +323,12 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.log.debug('Closing down network thread') self.network_thread.close() - self.log.info("Stopping nodes") - if self.nodes: - self.stop_nodes() + if self.success == TestStatus.FAILED: + self.log.info("Not stopping nodes as test failed. The dangling processes will be cleaned up later.") + else: + self.log.info("Stopping nodes") + if self.nodes: + self.stop_nodes() should_clean_up = ( not self.options.nocleanup and