aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_reindex_readonly.py
diff options
context:
space:
mode:
authorMatthew Zipkin <pinheadmz@gmail.com>2023-09-15 14:16:22 -0400
committerMatthew Zipkin <pinheadmz@gmail.com>2024-03-12 10:09:53 -0400
commitdfcef536d0e6c40e98dce35ae7af6e3e4a2595cd (patch)
treecfc82c83ad9f5a9f5d32c1cc6ab178150b2a1361 /test/functional/feature_reindex_readonly.py
parentd14c7286b653ad09a5a196aa351b325f97db546b (diff)
downloadbitcoin-dfcef536d0e6c40e98dce35ae7af6e3e4a2595cd.tar.xz
blockstorage: do not flush block to disk if it is already there
test: ensure we can reindex from read-only block files now
Diffstat (limited to 'test/functional/feature_reindex_readonly.py')
-rwxr-xr-xtest/functional/feature_reindex_readonly.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/functional/feature_reindex_readonly.py b/test/functional/feature_reindex_readonly.py
index dd99c3c4fa..25cff87a3b 100755
--- a/test/functional/feature_reindex_readonly.py
+++ b/test/functional/feature_reindex_readonly.py
@@ -24,6 +24,7 @@ class BlockstoreReindexTest(BitcoinTestFramework):
opreturn = "6a"
nulldata = fastprune_blockfile_size * "ff"
self.generateblock(self.nodes[0], output=f"raw({opreturn}{nulldata})", transactions=[])
+ block_count = self.nodes[0].getblockcount()
self.stop_node(0)
assert (self.nodes[0].chain_path / "blocks" / "blk00000.dat").exists()
@@ -73,10 +74,10 @@ class BlockstoreReindexTest(BitcoinTestFramework):
pass
if undo_immutable:
- self.log.info("Attempt to restart and reindex the node with the unwritable block file")
- with self.nodes[0].assert_debug_log(expected_msgs=['FlushStateToDisk', 'failed to open file'], unexpected_msgs=[]):
- self.nodes[0].assert_start_raises_init_error(extra_args=['-reindex', '-fastprune'],
- expected_msg="Error: A fatal internal error occurred, see debug.log for details")
+ self.log.debug("Attempt to restart and reindex the node with the unwritable block file")
+ with self.nodes[0].wait_for_debug_log([b"Reindexing finished"]):
+ self.start_node(0, extra_args=['-reindex', '-fastprune'])
+ assert block_count == self.nodes[0].getblockcount()
undo_immutable()
filename.chmod(0o777)