Skip to content

Commit e08886d

Browse files
committed
Merge pull request #6032
688da79 QA: add --noshutdown option to prevent stopping nodes (dexX7) 2eadeb2 QA: stop nodes after RPC tests, even with --nocleanup (dexX7)
2 parents 23c998d + 688da79 commit e08886d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

qa/rpc-tests/test_framework.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ def main(self):
8989
parser = optparse.OptionParser(usage="%prog [options]")
9090
parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true",
9191
help="Leave bitcoinds and test.* datadir on exit or error")
92+
parser.add_option("--noshutdown", dest="noshutdown", default=False, action="store_true",
93+
help="Don't stop bitcoinds after the test execution")
9294
parser.add_option("--srcdir", dest="srcdir", default="../../src",
93-
help="Source directory containing bitcoind/bitcoin-cli (default: %default%)")
95+
help="Source directory containing bitcoind/bitcoin-cli (default: %default)")
9496
parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"),
9597
help="Root directory for datadirs")
9698
parser.add_option("--tracerpc", dest="trace_rpc", default=False, action="store_true",
@@ -128,10 +130,15 @@ def main(self):
128130
print("Unexpected exception caught during testing: "+str(e))
129131
traceback.print_tb(sys.exc_info()[2])
130132

131-
if not self.options.nocleanup:
132-
print("Cleaning up")
133+
if not self.options.noshutdown:
134+
print("Stopping nodes")
133135
stop_nodes(self.nodes)
134136
wait_bitcoinds()
137+
else:
138+
print("Note: bitcoinds were not stopped and may still be running")
139+
140+
if not self.options.nocleanup and not self.options.noshutdown:
141+
print("Cleaning up")
135142
shutil.rmtree(self.options.tmpdir)
136143

137144
if success:

0 commit comments

Comments
 (0)