test: Add coverage for restarted node without any block sync

This commit is contained in:
Fabian Jahr 2025-04-03 19:51:46 +02:00
parent 3d7ab7ecb7
commit fd06157d14
No known key found for this signature in database
GPG Key ID: F13D1E9D890798CD

View File

@ -26,8 +26,8 @@ class InitTest(BitcoinTestFramework):
"""
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
self.setup_clean_chain = True
self.num_nodes = 2
self.uses_wallet = None
def init_stress_test(self):
@ -35,8 +35,10 @@ class InitTest(BitcoinTestFramework):
- test terminating initialization after seeing a certain log line.
- test removing certain essential files to test startup error paths.
"""
self.stop_node(0)
self.start_node(0)
node = self.nodes[0]
self.generate(node, 200, sync_fun=self.no_op)
self.stop_node(0)
def sigterm_node():
if platform.system() == 'Windows':
@ -290,10 +292,20 @@ class InitTest(BitcoinTestFramework):
assert_equal(result["height"], current_height)
node.wait_until_stopped()
def init_empty_test(self):
self.log.info("Test that stopping and restarting a node that has done nothing is not causing a failure")
options = [
[],
["-txindex=1", "-blockfilterindex=1", "-coinstatsindex=1"],
]
for option in options:
self.restart_node(1, option)
def run_test(self):
self.init_pid_test()
self.init_stress_test()
self.break_wait_test()
self.init_empty_test()
if __name__ == '__main__':