diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-09-27 14:43:27 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-10-08 01:04:29 -0700 |
commit | ec3916f40a3fc644ecbbaaddef6258937c7fcfbc (patch) | |
tree | bba4bbe9983387cafb8f4a1873d2e3e3516dce7c /test/functional/p2p_tx_download.py | |
parent | 283a73d7eaea2907a6f7f800f529a0d6db53d7a6 (diff) |
Use mockable time everywhere in net_processing
Diffstat (limited to 'test/functional/p2p_tx_download.py')
-rwxr-xr-x | test/functional/p2p_tx_download.py | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/test/functional/p2p_tx_download.py b/test/functional/p2p_tx_download.py index 653c7ae43f..5c3f021b3f 100755 --- a/test/functional/p2p_tx_download.py +++ b/test/functional/p2p_tx_download.py @@ -158,23 +158,19 @@ class TxDownloadTest(BitcoinTestFramework): self.nodes[0].p2ps[0].send_message(msg_notfound(vec=[CInv(MSG_TX, 1)])) def run_test(self): - # Setup the p2p connections - self.peers = [] - for node in self.nodes: - for _ in range(NUM_INBOUND): - self.peers.append(node.add_p2p_connection(TestP2PConn())) - - self.log.info("Nodes are setup with {} incoming connections each".format(NUM_INBOUND)) - - self.test_spurious_notfound() - - # Test the in-flight max first, because we want no transactions in - # flight ahead of this test. - self.test_in_flight_max() - - self.test_inv_block() - - self.test_tx_requests() + # Run each test against new bitcoind instances, as setting mocktimes has long-term effects on when + # the next trickle relay event happens. + for test in [self.test_spurious_notfound, self.test_in_flight_max, self.test_inv_block, self.test_tx_requests]: + self.stop_nodes() + self.start_nodes() + self.connect_nodes(1, 0) + # Setup the p2p connections + self.peers = [] + for node in self.nodes: + for _ in range(NUM_INBOUND): + self.peers.append(node.add_p2p_connection(TestP2PConn())) + self.log.info("Nodes are setup with {} incoming connections each".format(NUM_INBOUND)) + test() if __name__ == '__main__': |