test: fix race condition in p2p_v2_misbehaving.py peerid assertion #34060

pull stratospher wants to merge 1 commits into bitcoin:master from stratospher:2025_12_fix_peerid_race changing 1 files +2 −2
  1. stratospher commented at 3:05 pm on December 12, 2025: contributor

    Remove the hard-coded peer id from the debug message in p2p_v2_misbehaving.py.

    asyncio’s non-deterministic task scheduling might cause peer2’s connection to happen before peer1’s. since we test that peer2 remains connected, any disconnection must originate from peer1, making the specific peer id not necessary for test correctness. so we can remove the hard coded peer id from the expected debug log message.

    Fixes #34035.

  2. test: fix race condition in p2p_v2_misbehaving.py peerid assertion
    due to asyncio's non-deterministic task scheduling, peer2's
    connection might happen before peer1's, causing peer2 to get
    assigned peer_id=1 on bitcoind side and peer1 to get assigned
    peer_id=2 on bitcoind side.
    
    since we test that peer2 remains connected, any disconnection
    must originate from peer1, making the specific peer id unnecessary
    for test correctness. so we can remove the specific peer_id from
    the expected debug log.
    09dfa4d3f8
  3. DrahtBot added the label Tests on Dec 12, 2025
  4. DrahtBot commented at 3:05 pm on December 12, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34060.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK mzumsande, maflcko

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. fanquake commented at 12:37 pm on December 14, 2025: member
  6. mzumsande commented at 6:59 pm on December 15, 2025: contributor

    Code Review ACK 09dfa4d3f8dfbea61a73d4add79e2464ca776571

    seems like the most simple fix for this very rare timeout.

  7. maflcko commented at 12:49 pm on December 16, 2025: member
    lgtm ACK 09dfa4d3f8dfbea61a73d4add79e2464ca776571
  8. fanquake merged this on Dec 16, 2025
  9. fanquake closed this on Dec 16, 2025


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-02-02 06:13 UTC

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