0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

Merge bitcoin/bitcoin#29933: test: Fix intermittent timeout in p2p_tx_download.py

fa6c300a99 test: Fix intermittent timeout in p2p_tx_download.py (MarcoFalke)

Pull request description:

  Currently the test passes, but may fail during shutdown, because blocks and transactions are synced with `NUM_INBOUND` * `self.num_nodes` peers, which may take a long time.

  There is no need for this test to have this amount of inbounds.

  So avoid the extraneous inbounds to speed up the test and avoid the intermittent test failures.

ACKs for top commit:
  instagibbs:
    ACK fa6c300a99
  fjahr:
    Thanks, ACK fa6c300a99
  achow101:
    ACK fa6c300a99
  theStack:
    ACK fa6c300a99

Tree-SHA512: 0a480fd1db293ed8571ae629557cf81d5a79ec883e9e635f22c8a7cf48427161249ad2180b66c67661306f696c977b8e06ad520bd11911f119c9c95b3ffc9134
This commit is contained in:
Ava Chow 2024-04-22 18:12:28 -04:00
commit 10bd32a1c9
No known key found for this signature in database
GPG key ID: 17565732E08E5E41

View file

@ -284,17 +284,22 @@ class TxDownloadTest(BitcoinTestFramework):
# Run each test against new bitcoind instances, as setting mocktimes has long-term effects on when # Run each test against new bitcoind instances, as setting mocktimes has long-term effects on when
# the next trickle relay event happens. # the next trickle relay event happens.
for test in [self.test_in_flight_max, self.test_inv_block, self.test_tx_requests, for test, with_inbounds in [
self.test_rejects_filter_reset]: (self.test_in_flight_max, True),
(self.test_inv_block, True),
(self.test_tx_requests, True),
(self.test_rejects_filter_reset, False),
]:
self.stop_nodes() self.stop_nodes()
self.start_nodes() self.start_nodes()
self.connect_nodes(1, 0) self.connect_nodes(1, 0)
# Setup the p2p connections # Setup the p2p connections
self.peers = [] self.peers = []
for node in self.nodes: if with_inbounds:
for _ in range(NUM_INBOUND): for node in self.nodes:
self.peers.append(node.add_p2p_connection(TestP2PConn())) for _ in range(NUM_INBOUND):
self.log.info("Nodes are setup with {} incoming connections each".format(NUM_INBOUND)) self.peers.append(node.add_p2p_connection(TestP2PConn()))
self.log.info("Nodes are setup with {} incoming connections each".format(NUM_INBOUND))
test() test()