0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

[test] Add manual prune startup test case

This commit is contained in:
dergoegge 2023-03-13 12:55:03 +01:00
parent 4517419628
commit 05eeba2c5f

View file

@ -69,6 +69,7 @@ class BlockchainTest(BitcoinTestFramework):
def run_test(self):
self.wallet = MiniWallet(self.nodes[0])
self._test_prune_disk_space()
self.mine_chain()
self._test_max_future_block_time()
self.restart_node(
@ -100,6 +101,13 @@ class BlockchainTest(BitcoinTestFramework):
self.generate(self.wallet, 1)
assert_equal(self.nodes[0].getblockchaininfo()['blocks'], HEIGHT)
def _test_prune_disk_space(self):
self.log.info("Test that a manually pruned node does not run into "
"integer overflow on first start up")
self.restart_node(0, extra_args=["-prune=1"])
self.log.info("Avoid warning when assumed chain size is enough")
self.restart_node(0, extra_args=["-prune=123456789"])
def _test_max_future_block_time(self):
self.stop_node(0)
self.log.info("A block tip of more than MAX_FUTURE_BLOCK_TIME in the future raises an error")