test: fix intermittent failures in feature_proxy.py #30545

pull mzumsande wants to merge 1 commits into bitcoin:master from mzumsande:202407_fix_feature_proxy changing 1 files +6 −5
  1. mzumsande commented at 7:49 pm on July 29, 2024: contributor

    Fixes #29871

    If addnode connections are made with v2transport and the peer immediately disconnects us, reconnections with v1 are scheduled. This could interfere with later checks depending on timing. Avoid this by using v2transport=False in the addnode rpc - this test isn’t about the message layer anyway, so running it with v2 would add no value.

  2. DrahtBot commented at 7:49 pm on July 29, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, tdb3

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Tests on Jul 29, 2024
  4. tdb3 approved
  5. tdb3 commented at 1:58 am on July 30, 2024: contributor
    ACK c2a56ba60a864be2f7b67aeb5e330241a8dfb770 Reviewed changes and ran all unit/functional tests locally (passed). Ran feature_proxy wth --v2transport multiple times (10) in case there was remaining intermittency (didn’t expect any since addnode calls are now v2transport=false). No failures encountered.
  6. in test/functional/feature_proxy.py:152 in c2a56ba60a outdated
    147@@ -148,7 +148,8 @@ def node_test(self, node, *, proxies, auth, test_onion, test_cjdns):
    148         rv = []
    149         addr = "15.61.23.23:1234"
    150         self.log.debug(f"Test: outgoing IPv4 connection through node {node.index} for address {addr}")
    151-        node.addnode(addr, "onetry")
    152+        # v2transport=False is used to avoid reconnections with v1 being scheduled. These could interfere with later checks.
    153+        node.addnode(addr, "onetry", False)
    


    maflcko commented at 7:09 am on July 30, 2024:
    0        node.addnode(addr, "onetry", v2transport=False)
    

    Not sure about using integer and bool literals to call functions. It would be better to use named args. Otherwise, it is impossible to see the meaning of the literal from reading the line of code alone.


    mzumsande commented at 3:02 pm on July 30, 2024:
    done, thanks!
  7. maflcko approved
  8. maflcko commented at 7:09 am on July 30, 2024: member

    lgtm

    Left a nit

  9. test: fix intermittent failures in feature_proxy.py
    If addnode connections are made with v2transport and the peer immediately disconnects us, reconnections
    with v1 are scheduled. This could interfere with later checks depending on timing. Avoid this by using
    `v2transport=False` in the addnode rpc - this test isn't about the message layer anyway, so running it
    with v2 would add no value.
    a6efc7e16e
  10. mzumsande force-pushed on Jul 30, 2024
  11. mzumsande commented at 3:03 pm on July 30, 2024: contributor
    c2a56ba to a6efc7e: Updated to use named args.
  12. maflcko commented at 3:51 pm on July 30, 2024: member
    ACK a6efc7e16ed23377705a0a6a3445cab0acfd7ccc
  13. DrahtBot requested review from tdb3 on Jul 30, 2024
  14. maflcko added this to the milestone 28.0 on Jul 30, 2024
  15. tdb3 approved
  16. tdb3 commented at 4:08 pm on July 30, 2024: contributor
    cr re ACK a6efc7e16ed23377705a0a6a3445cab0acfd7ccc
  17. fanquake merged this on Jul 31, 2024
  18. fanquake closed this on Jul 31, 2024

  19. mzumsande deleted the branch on Jul 31, 2024


mzumsande DrahtBot tdb3 maflcko

Labels
Tests

Milestone
28.0


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: 2024-09-16 19:12 UTC

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