Merge bitcoin/bitcoin#31751: test: fix intermittent timeout in p2p_1p1c_network.py
Some checks failed
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
CI / test each commit (push) Has been cancelled
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Has been cancelled
CI / macOS 14 native, arm64, fuzz (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / Win64 native fuzz, VS 2022 (push) Has been cancelled

152a2dcdef test: fix intermittent timeout in p2p_1p1c_network.py (Martin Zumsande)

Pull request description:

  The timeout is due to outstanding txrequests with python peers, which have the same timeout (`60s`) as the mempool sync timeout.
  I explained this in more detail in https://github.com/bitcoin/bitcoin/issues/31721#issuecomment-2620169640 and also mentioned there how to reproduce it.

  Fix this by disconnecting the python peers after they send their txns, they aren't needed after this point anyway because the main goal of the test is the sync between the 4 full nodes.

  Fixes #31721

ACKs for top commit:
  achow101:
    ACK 152a2dcdef
  instagibbs:
    reACK 152a2dcdef
  marcofleon:
    ACK 152a2dcdef
  glozow:
    reACK 152a2dcdef

Tree-SHA512: 908c58933d8e9fcca91425fce1b7c9c7cb7121a6d26840630e03a442356ad2a327d1e087df72a19caa97024ea827593e10f2ff93838f88939458e73df9857df0
This commit is contained in:
Ava Chow 2025-01-29 18:07:32 -05:00
commit 809d7e763c
No known key found for this signature in database
GPG key ID: 17565732E08E5E41

View file

@ -144,6 +144,11 @@ class PackageRelayTest(BitcoinTestFramework):
for tx in transactions_to_presend[i]:
peer.send_and_ping(msg_tx(tx))
# Disconnect python peers to clear outstanding orphan requests with them, avoiding timeouts.
# We are only interested in the syncing behavior between real nodes.
for i in range(self.num_nodes):
self.nodes[i].disconnect_p2ps()
self.log.info("Submit full packages to node0")
for package_hex in packages_to_submit:
submitpackage_result = self.nodes[0].submitpackage(package_hex)