mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
test: Remove --noshutdown flag
This commit is contained in:
parent
fad441fba0
commit
fa0dc09b90
2 changed files with 4 additions and 13 deletions
|
@ -171,8 +171,6 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
parser = argparse.ArgumentParser(usage="%(prog)s [options]")
|
||||
parser.add_argument("--nocleanup", dest="nocleanup", default=False, action="store_true",
|
||||
help="Leave bitcoinds and test.* datadir on exit or error")
|
||||
parser.add_argument("--noshutdown", dest="noshutdown", default=False, action="store_true",
|
||||
help="Don't stop bitcoinds after the test execution")
|
||||
parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(test_file) + "/../cache"),
|
||||
help="Directory for caching pregenerated datadirs (default: %(default)s)")
|
||||
parser.add_argument("--tmpdir", dest="tmpdir", help="Root directory for datadirs (must not exist)")
|
||||
|
@ -325,18 +323,12 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
|
||||
self.log.debug('Closing down network thread')
|
||||
self.network_thread.close()
|
||||
if not self.options.noshutdown:
|
||||
self.log.info("Stopping nodes")
|
||||
if self.nodes:
|
||||
self.stop_nodes()
|
||||
else:
|
||||
for node in self.nodes:
|
||||
node.cleanup_on_exit = False
|
||||
self.log.info("Note: bitcoinds were not stopped and may still be running")
|
||||
self.log.info("Stopping nodes")
|
||||
if self.nodes:
|
||||
self.stop_nodes()
|
||||
|
||||
should_clean_up = (
|
||||
not self.options.nocleanup and
|
||||
not self.options.noshutdown and
|
||||
self.success != TestStatus.FAILED and
|
||||
not self.options.perf
|
||||
)
|
||||
|
|
|
@ -159,7 +159,6 @@ class TestNode():
|
|||
self.rpc = None
|
||||
self.url = None
|
||||
self.log = logging.getLogger('TestFramework.node%d' % i)
|
||||
self.cleanup_on_exit = True # Whether to kill the node when this object goes away
|
||||
# Cache perf subprocesses here by their data output filename.
|
||||
self.perf_subprocesses = {}
|
||||
|
||||
|
@ -201,7 +200,7 @@ class TestNode():
|
|||
def __del__(self):
|
||||
# Ensure that we don't leave any bitcoind processes lying around after
|
||||
# the test ends
|
||||
if self.process and self.cleanup_on_exit:
|
||||
if self.process:
|
||||
# Should only happen on test failure
|
||||
# Avoid using logger, as that may have already been shutdown when
|
||||
# this destructor is called.
|
||||
|
|
Loading…
Add table
Reference in a new issue