TestNode.stop_node
. Add a destructor to TestNode
that cleans this up.
TestNode.stop_node
. Add a destructor to TestNode
that cleans this up.
I have been able to reproduce the issue of bitcoind processes living on after tests exit in a couple ways:
This PR causes all nodes to exit in both those situations.
83@@ -84,6 +84,13 @@ def __init__(self, i, datadir, rpchost, timewait, binary, stderr, mocktime, cove
84
85 self.p2ps = []
86
87+ def __del__(self):
88+ # Ensure that we don't leave any bitcoind processes lying around after
89+ # the test ends
90+ if self.process:
91+ self.log.info("Cleaning up leftover process")
logging.shutdown()
, but the documentation states that no calls to logging should be made after shutdown: https://docs.python.org/3/library/logging.html#logging.shutdown
Seems reasonable. I don’t think this can do any harm.
utACK ccc9031c69e67c336362b197c7decf14af98a877
self.process
to None
in feature_help.py
?
Tested ACK f1d91ef.
Using the instructions in #12902 (comment) with this change kills all test processes.
Code looks good, please squash.