From 370e05d06bfca9abf4b69f5a2b53ede555d62775 Mon Sep 17 00:00:00 2001 From: lateminer <9951982+lateminer@users.noreply.github.com> Date: Wed, 24 Jan 2024 22:36:21 +0100 Subject: [PATCH] test: Remove test --- .../feature_remove_pruned_files_on_startup.py | 54 ------------------- test/functional/test_runner.py | 1 - 2 files changed, 55 deletions(-) delete mode 100755 test/functional/feature_remove_pruned_files_on_startup.py diff --git a/test/functional/feature_remove_pruned_files_on_startup.py b/test/functional/feature_remove_pruned_files_on_startup.py deleted file mode 100755 index ca0e5ace9f..0000000000 --- a/test/functional/feature_remove_pruned_files_on_startup.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -"""Test removing undeleted pruned blk files on startup.""" - -import os -from test_framework.test_framework import BitcoinTestFramework - -class FeatureRemovePrunedFilesOnStartupTest(BitcoinTestFramework): - def set_test_params(self): - self.num_nodes = 1 - self.extra_args = [["-fastprune", "-prune=1"]] - - def mine_batches(self, blocks): - n = blocks // 250 - for _ in range(n): - self.generate(self.nodes[0], 250) - self.generate(self.nodes[0], blocks % 250) - self.sync_blocks() - - def run_test(self): - blk0 = os.path.join(self.nodes[0].datadir, self.nodes[0].chain, 'blocks', 'blk00000.dat') - rev0 = os.path.join(self.nodes[0].datadir, self.nodes[0].chain, 'blocks', 'rev00000.dat') - blk1 = os.path.join(self.nodes[0].datadir, self.nodes[0].chain, 'blocks', 'blk00001.dat') - rev1 = os.path.join(self.nodes[0].datadir, self.nodes[0].chain, 'blocks', 'rev00001.dat') - self.mine_batches(800) - fo1 = os.open(blk0, os.O_RDONLY) - fo2 = os.open(rev1, os.O_RDONLY) - fd1 = os.fdopen(fo1) - fd2 = os.fdopen(fo2) - self.nodes[0].pruneblockchain(600) - - # Windows systems will not remove files with an open fd - if os.name != 'nt': - assert not os.path.exists(blk0) - assert not os.path.exists(rev0) - assert not os.path.exists(blk1) - assert not os.path.exists(rev1) - else: - assert os.path.exists(blk0) - assert not os.path.exists(rev0) - assert not os.path.exists(blk1) - assert os.path.exists(rev1) - - # Check that the files are removed on restart once the fds are closed - fd1.close() - fd2.close() - self.restart_node(0) - assert not os.path.exists(blk0) - assert not os.path.exists(rev1) - -if __name__ == '__main__': - FeatureRemovePrunedFilesOnStartupTest().main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 27f7a3093b..a73aeac60b 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -335,7 +335,6 @@ 'p2p_permissions.py', 'feature_blocksdir.py', 'wallet_startup.py', - 'feature_remove_pruned_files_on_startup.py', 'p2p_i2p_ports.py', 'p2p_i2p_sessions.py', 'feature_config_args.py',