From 175a46f4ad2357245b9346e622872e08b6abb20e Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 27 Aug 2024 21:54:05 +0300 Subject: [PATCH] test: a simpler way to disable mocktime in `p2p_initial_headers_sync.py` --- test/functional/p2p_initial_headers_sync.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/test/functional/p2p_initial_headers_sync.py b/test/functional/p2p_initial_headers_sync.py index af3dd1615116c..7bf35e9737e1b 100755 --- a/test/functional/p2p_initial_headers_sync.py +++ b/test/functional/p2p_initial_headers_sync.py @@ -30,19 +30,9 @@ def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 - def setup_chain(self): - # This test operates under the assumption that the adjusted time is well ahead of block - # time. - # - # By default when we setup a new chain, we also adjust the mocktime (this is not done in - # Bitcoin's test suite), which violates this test's assumption and causes it to fail. We - # remedy this by ensuring the test's assumptions are met (i.e. we don't adjust mocktime) - # - self.log.info("Initializing test directory " + self.options.tmpdir) - if self.setup_clean_chain: - self._initialize_chain_clean() - else: - self._initialize_chain() + def setup_network(self): + self.disable_mocktime() + super().setup_network() def announce_random_block(self, peers): new_block_announcement = msg_inv(inv=[CInv(MSG_BLOCK, random.randrange(1<<256))])