test: Fix intermittent timeout in p2p_permissions.py #26854

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2301-test-timeout-p2p-perm-💙 changing 1 files +4 −0
  1. maflcko commented at 1:44 PM on January 9, 2023: member

    The sync is based on bytesrecv_per_msg["verack"]. However, the bytes are counted before processing the message, so they are not sufficient to ensure the connection is fully up.

  2. maflcko force-pushed on Jan 9, 2023
  3. DrahtBot commented at 1:44 PM on January 9, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK mzumsande, aureleoules

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

  4. DrahtBot added the label Tests on Jan 9, 2023
  5. mzumsande commented at 7:20 PM on January 9, 2023: contributor

    This runs into other timeouts (p2p_node_network_limited.py, see CI) although the test passes for me locally.

  6. test: Fix intermittent timeout in p2p_permissions.py fa1bf4e705
  7. maflcko force-pushed on Jan 11, 2023
  8. maflcko commented at 2:21 PM on January 11, 2023: member

    Thanks. Fixed by replacing == with >=. (There can only be one verack msg, but there can be multiple pong msgs per connection)

  9. mzumsande commented at 5:00 PM on January 11, 2023: contributor

    Is this also a fix for the mempool timeouts in #26440?

  10. maflcko commented at 5:04 PM on January 11, 2023: member

    Seems likely, but not sure if this is possible to tell without having Cirrus CI upload the full datadir + test log of the failure

  11. mzumsande commented at 8:36 PM on January 11, 2023: contributor

    ACK fa1bf4e7052e617dd0e5c8c54969d84314af9577

    This makes the test code dependent on their being a ping right after connection setup (which is the case today because m_ping_start=0us initially, but one could imagine other ways of initialization.

    Another possibility might be to expose fSuccessfullyConnected via RPC (e.g. in getpeerinfo) and use that, but I'm not sure if that is better if that field is not really interesting to user and just used by tests.

  12. maflcko commented at 10:16 PM on January 11, 2023: member

    (which is the case today because m_ping_start=0us initially, but one could imagine other ways of initialization.

    In the unlikely case that this is changed, it should be possible to just call the ping RPC at the right time to achieve the same.

  13. aureleoules approved
  14. aureleoules commented at 11:44 AM on January 12, 2023: member

    ACK fa1bf4e7052e617dd0e5c8c54969d84314af9577

    I verified I could reproduce the failure on master with rr but not on this branch.

  15. maflcko merged this on Jan 12, 2023
  16. maflcko closed this on Jan 12, 2023

  17. maflcko deleted the branch on Jan 12, 2023
  18. sidhujag referenced this in commit cb433cfd2d on Jan 12, 2023
  19. bitcoin locked this on Jan 12, 2024

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-24 06:14 UTC

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