Skip to content

Commit faf2f2c

Browse files
MarcoFalkehodlinator
andcommitted
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>
1 parent fae3bf6 commit faf2f2c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,12 @@ def shutdown(self):
323323

324324
self.log.debug('Closing down network thread')
325325
self.network_thread.close()
326-
self.log.info("Stopping nodes")
327-
if self.nodes:
328-
self.stop_nodes()
326+
if self.success == TestStatus.FAILED:
327+
self.log.info("Not stopping nodes as test failed. The dangling processes will be cleaned up later.")
328+
else:
329+
self.log.info("Stopping nodes")
330+
if self.nodes:
331+
self.stop_nodes()
329332

330333
should_clean_up = (
331334
not self.options.nocleanup and

0 commit comments

Comments
 (0)