test: Fix out-of-range port collisions #25333

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2206-test-collide-🚉 changing 3 files +10 −19
  1. MarcoFalke commented at 10:56 AM on June 10, 2022: member

    Otherwise the test will fail if two tests running in parallel use the same port. See #25096 (review) and https://github.com/bitcoin/bitcoin/pull/25312

  2. fanquake added the label Tests on Jun 10, 2022
  3. MarcoFalke commented at 12:48 PM on June 10, 2022: member

    The failure would only be intermittent (maybe with a probability of 1%?)

  4. test: Fix out-of-range port collisions fa7a711a30
  5. in test/functional/feature_bind_extra.py:48 in fa46ea0196 outdated
      44 | @@ -45,8 +45,8 @@ def setup_network(self):
      45 |  
      46 |          loopback_ipv4 = addr_to_hex("127.0.0.1")
      47 |  
      48 | -        # Start custom ports after p2p and rpc ports.
    


    dergoegge commented at 1:42 PM on June 10, 2022:

    The comment above here is now no longer true and could be removed/altered. https://github.com/bitcoin/bitcoin/blob/fa46ea0196fda9e41a2feeeed47ff4f6b9d7dfab/test/functional/feature_bind_extra.py#L36-L39

    p2p_port is usable in set_test_params since #25312. (arguably that PR should have changed the comment as well)


    MarcoFalke commented at 1:56 PM on June 10, 2022:

    Thx, fixed.

  6. MarcoFalke force-pushed on Jun 10, 2022
  7. dergoegge commented at 2:19 PM on June 10, 2022: member

    ACK fa7a711a30b707cbdee4435dd0a956bffb7aaccb - This gets rid of some rather arbitrary choices for ports in some of our functional tests that can cause port collisions across test runs, resulting in intermittent failures.

    Using left over p2p ports (p2p_port(n)) for custom ports seems OK. In the long run (if needed) we could consider adding a third port range to the tests for custom ports (as suggested in #25096 (review)).

  8. MarcoFalke merged this on Jun 10, 2022
  9. MarcoFalke closed this on Jun 10, 2022

  10. MarcoFalke deleted the branch on Jun 10, 2022
  11. sidhujag referenced this in commit 2f19558748 on Jun 13, 2022
  12. Fabcien referenced this in commit 1efb53c8e3 on Apr 27, 2023
  13. DrahtBot locked this on Jun 10, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me