mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge bitcoin/bitcoin#25034: test: add missing stop_node calls to feature_coinstatsindex and feature_prune
a3cd7dbfd8200c580aae9ea0f5473d58107dd582 test: stop node before calling assert_start_raises_init_error (Martin Zumsande) Pull request description: In #24789, I forgot to stop the node before using `assert_start_raises_init_error` in `feature_coinstatsindex`. This resulted in a bitcoind process that is not being terminated after the test finishes. `feature_prune` has the same problem and also creates a zombie bitcoind process. Also adds an assert to `assert_start_raises_init_error` to make sure the node isn't already running to prevent this sort of mistake in the future. Top commit has no ACKs. Tree-SHA512: 902f683ebe7b19ca32ab83ca40d9698e9d91509b1d003f21a7221f79b647e05b6ef5c0c888fbb772cbca5e641d5c9437d522b6671f446c3ab321d79f7c6d0284
This commit is contained in:
parent
6157e67a55
commit
766c2c2757
@ -253,11 +253,13 @@ class CoinStatsIndexTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
self.log.info("Test that -reindex-chainstate is disallowed with coinstatsindex")
|
self.log.info("Test that -reindex-chainstate is disallowed with coinstatsindex")
|
||||||
|
|
||||||
|
self.stop_node(1)
|
||||||
self.nodes[1].assert_start_raises_init_error(
|
self.nodes[1].assert_start_raises_init_error(
|
||||||
expected_msg='Error: -reindex-chainstate option is not compatible with -coinstatsindex. '
|
expected_msg='Error: -reindex-chainstate option is not compatible with -coinstatsindex. '
|
||||||
'Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
|
'Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
|
||||||
extra_args=['-coinstatsindex', '-reindex-chainstate'],
|
extra_args=['-coinstatsindex', '-reindex-chainstate'],
|
||||||
)
|
)
|
||||||
|
self.restart_node(1, extra_args=["-coinstatsindex"])
|
||||||
|
|
||||||
def _test_use_index_option(self):
|
def _test_use_index_option(self):
|
||||||
self.log.info("Test use_index option for nodes running the index")
|
self.log.info("Test use_index option for nodes running the index")
|
||||||
|
@ -564,6 +564,7 @@ class TestNode():
|
|||||||
|
|
||||||
Will throw if dashd starts without an error.
|
Will throw if dashd starts without an error.
|
||||||
Will throw if an expected_msg is provided and it does not match dashd's stdout."""
|
Will throw if an expected_msg is provided and it does not match dashd's stdout."""
|
||||||
|
assert not self.running
|
||||||
with tempfile.NamedTemporaryFile(dir=self.stderr_dir, delete=False) as log_stderr, \
|
with tempfile.NamedTemporaryFile(dir=self.stderr_dir, delete=False) as log_stderr, \
|
||||||
tempfile.NamedTemporaryFile(dir=self.stdout_dir, delete=False) as log_stdout:
|
tempfile.NamedTemporaryFile(dir=self.stdout_dir, delete=False) as log_stdout:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user