test: Fix wait_for_getheaders() call in test_outbound_eviction_blocks_relay_only() #32823

pull pablomartin4btc wants to merge 2 commits into bitcoin:master from pablomartin4btc:test_p2p_outbound_eviction_block_relay_fix changing 1 files +15 −13
  1. pablomartin4btc commented at 5:24 pm on June 27, 2025: member

    This change avoids relying on tip_header.hash, which is None when the header is deserialized from hex during CBlockHeader() construction. Instead, tip_header.rehash() explicitly computes the hash, making the test behavior more robust.

    Using the explicit rehash() avoids depending on wait_for_getheaders() falling back to any received message, thus making the test more deterministic.

    This is a follow-up to #32742.

    Also, as noted in a previous review comment, “the hash field is wrong either way, simply due to being the wrong type (it is an optional hex string), as opposed to an optional int”.


    The first commit intention is to improve clarity around the tests purpose, helping reviewers follow what’s being verified and why. What started as a small comment during review of #32742 led me reviewing and try to improve most relevant tests comments for consistency and correctness.

  2. test: Clarify roles in outbound eviction comments
    Some ambiguous uses of "we" referring to either the node or the peer are replaced with clearer phrasing.
    
    Also rephrase some comments for consistency and readability.
    
    Applies to all relevant outbound eviction tests in p2p_eviction_logic.py.
    26598ed21e
  3. test: Use rehash() in outbound eviction block-relay
    Ensure that tip_header.rehash() is used instead of tip_header.hash, which is None when the header is deserialized from hex.
    
    This avoids depending on wait_for_getheaders() falling back to any received message, making the test more explicit and robust.
    ec004cdb86
  4. DrahtBot added the label Tests on Jun 27, 2025
  5. DrahtBot commented at 5:24 pm on June 27, 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/32823.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  6. fanquake requested review from theStack on Jun 30, 2025


pablomartin4btc DrahtBot


theStack

Labels
Tests


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: 2025-06-30 21:12 UTC

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