aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2022-04-29 21:35:05 +0200
committerMartin Zumsande <mzumsande@gmail.com>2022-04-29 22:50:26 +0200
commita3cd7dbfd8200c580aae9ea0f5473d58107dd582 (patch)
tree2b39324aaecd706759d7a348fc32fea47cdf187e
parent26296eba3dc34043b025bda167386c47693705b5 (diff)
test: stop node before calling assert_start_raises_init_error
...in feature_coinstatsindex and feature_pruning. Also add an assert to assert_start_raises_init_error that the node is not already running.
-rwxr-xr-xtest/functional/feature_coinstatsindex.py2
-rwxr-xr-xtest/functional/feature_pruning.py1
-rwxr-xr-xtest/functional/test_framework/test_node.py1
3 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py
index 251aa2114b..2e21638f80 100755
--- a/test/functional/feature_coinstatsindex.py
+++ b/test/functional/feature_coinstatsindex.py
@@ -231,11 +231,13 @@ class CoinStatsIndexTest(BitcoinTestFramework):
self.log.info("Test that -reindex-chainstate is disallowed with coinstatsindex")
+ self.stop_node(1)
self.nodes[1].assert_start_raises_init_error(
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.',
extra_args=['-coinstatsindex', '-reindex-chainstate'],
)
+ self.restart_node(1, extra_args=["-coinstatsindex"])
def _test_use_index_option(self):
self.log.info("Test use_index option for nodes running the index")
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index 4110526d15..77524e85a3 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -125,6 +125,7 @@ class PruneTest(BitcoinTestFramework):
self.sync_blocks(self.nodes[0:5])
def test_invalid_command_line_options(self):
+ self.stop_node(0)
self.nodes[0].assert_start_raises_init_error(
expected_msg='Error: Prune cannot be configured with a negative value.',
extra_args=['-prune=-1'],
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index e56d4aa492..7d2db391b6 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -545,6 +545,7 @@ class TestNode():
Will throw if bitcoind starts without an error.
Will throw if an expected_msg is provided and it does not match bitcoind's stdout."""
+ assert not self.running
with tempfile.NamedTemporaryFile(dir=self.stderr_dir, delete=False) as log_stderr, \
tempfile.NamedTemporaryFile(dir=self.stdout_dir, delete=False) as log_stdout:
try: