test: addrman: check isTerrible when time is more than 10min in the future #33533

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2025-10-addrman-test-10min changing 1 files +7 −1
  1. brunoerg commented at 1:29 pm on October 3, 2025: contributor

    This PR adds test coverage to kill the following mutant (https://corecheck.dev/mutation/src/addrman.cpp#L76):

     0diff --git a/src/addrman.cpp b/src/addrman.cpp
     1index 9c3a24db90..0ffd349315 100644
     2--- a/src/addrman.cpp
     3+++ b/src/addrman.cpp
     4@@ -73,7 +73,7 @@ bool AddrInfo::IsTerrible(NodeSeconds now) const
     5     }
     6
     7     if (nTime > now + 10min) { // came in a flying DeLorean
     8-        return true;
     9+        return false;
    10     }
    

    When the nTime is set 10 minutes in the future the addr should be marked as terrible.

  2. test: addrman: check isTerrible when time is more than 10min in the future 8e47ed6906
  3. DrahtBot added the label Tests on Oct 3, 2025
  4. DrahtBot commented at 1:29 pm on October 3, 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/33533.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Crypt-iQ, danielabrozzoni, marcofleon

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

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • should be isTerrible = true -> should be isTerrible == true [makes the intent clear that this is a boolean check rather than an assignment; improves readability of the comment]

    drahtbot_id_5_m

  5. Crypt-iQ commented at 2:49 pm on October 3, 2025: contributor
    crACK 8e47ed6906d5e381498681e2cab9f2e318597705
  6. fanquake requested review from marcofleon on Oct 3, 2025
  7. danielabrozzoni commented at 5:42 pm on October 3, 2025: contributor

    tACK 8e47ed6906d5e381498681e2cab9f2e318597705

    I verified that mutating the isTerrible condition did not cause any tests to fail on master, while this PR correctly triggers a test failure.

  8. marcofleon commented at 5:54 pm on October 3, 2025: contributor
    Nice, code review ACK 8e47ed6906d5e381498681e2cab9f2e318597705
  9. fanquake merged this on Oct 3, 2025
  10. fanquake closed this on Oct 3, 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: 2025-10-10 12:13 UTC

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