MCPcopy Create free account
hub / github.com/ElementsProject/elements / test_height_min

Method test_height_min

test/functional/feature_pruning.py:145–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 )
144
145 def test_height_min(self):
146 assert os.path.isfile(os.path.join(self.prunedir, "blk00000.dat")), "blk00000.dat is missing, pruning too early"
147 self.log.info("Success")
148 self.log.info(f"Though we're already using more than 550MiB, current usage: {calc_usage(self.prunedir)}")
149 self.log.info("Mining 25 more blocks should cause the first block file to be pruned")
150 # Pruning doesn't run until we're allocating another chunk, 20 full blocks past the height cutoff will ensure this
151 mine_large_blocks(self.nodes[0], 25)
152
153 # Wait for blk00000.dat to be pruned
154 self.wait_until(lambda: not os.path.isfile(os.path.join(self.prunedir, "blk00000.dat")), timeout=30)
155
156 self.log.info("Success")
157 usage = calc_usage(self.prunedir)
158 self.log.info(f"Usage should be below target: {usage}")
159 assert_greater_than(550, usage)
160
161 def create_chain_with_staleblocks(self):
162 # Create stale blocks in manageable sized chunks

Callers 1

run_testMethod · 0.95

Calls 6

assert_greater_thanFunction · 0.90
mine_large_blocksFunction · 0.85
infoMethod · 0.80
calc_usageFunction · 0.70
joinMethod · 0.45
wait_untilMethod · 0.45

Tested by

no test coverage detected