Skip to content

Commit dfd0a76

Browse files
committed
test: Check datadir cleanup after assumeutxo was successful
1 parent 4571939 commit dfd0a76

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/functional/feature_assumeutxo.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,11 @@ def check_tx_counts(final: bool) -> None:
644644
for i in (0, 1):
645645
n = self.nodes[i]
646646
self.log.info(f"Restarting node {i} to ensure (Check|Load)BlockIndex passes")
647-
self.restart_node(i, extra_args=self.extra_args[i])
647+
# Ensure the assumutxo node has cleaned up the background chainstate
648+
cleanup_msg = ["cleaning up unneeded background chainstate"] if i != 0 else []
649+
with n.assert_debug_log(cleanup_msg):
650+
self.restart_node(i, extra_args=self.extra_args[i])
651+
assert not (n.datadir_path / "regtest" / "chainstate_snapshot").exists()
648652

649653
assert_equal(n.getblockchaininfo()["blocks"], FINAL_HEIGHT)
650654

@@ -721,7 +725,11 @@ def check_tx_counts(final: bool) -> None:
721725
for i in (0, 2):
722726
n = self.nodes[i]
723727
self.log.info(f"Restarting node {i} to ensure (Check|Load)BlockIndex passes")
724-
self.restart_node(i, extra_args=self.extra_args[i])
728+
# Ensure the assumeutxo node has cleaned up the background chainstate
729+
cleanup_msg = ["cleaning up unneeded background chainstate"] if i != 0 else []
730+
with n.assert_debug_log(cleanup_msg):
731+
self.restart_node(i, extra_args=self.extra_args[i])
732+
assert not (n.datadir_path / "regtest" / "chainstate_snapshot").exists()
725733

726734
assert_equal(n.getblockchaininfo()["blocks"], FINAL_HEIGHT)
727735

0 commit comments

Comments
 (0)