test: Cover AddrMan add edge cases #36229

pull mertsaner wants to merge 1 commits into bitcoin:master from mertsaner:test/addrman-add-edge-cases changing 1 files +164 −0
  1. mertsaner commented at 4:31 PM on September 11, 2026: none

    Add focused unit tests for meaningful AddrMan::Add edge cases without changing production behavior.

    The tests cover:

    empty and rejected batches; mixed batches containing rejected and valid addresses; duplicate records within a batch; rejection of unroutable addresses; timestamp penalty clamping at zero; one-hour and 24-hour timestamp update boundaries using a deterministic fake clock; preservation of source-derived bucket placement across newer announcements; preservation of tried-table membership for newer records; and service flags being merged without removing previously known capabilities.

  2. DrahtBot added the label Tests on Sep 11, 2026
  3. DrahtBot commented at 4:31 PM on September 11, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • addrman->GetAddr(0, 0, std::nullopt, false) in src/test/addrman_tests.cpp

    <sup>2026-09-12 05:47:34</sup>

  4. mertsaner force-pushed on Sep 11, 2026
  5. brunoerg commented at 7:46 PM on September 11, 2026: contributor

    corecheck doesn't show any gained coverage, can you tell us what these edge cases are addressing in practice? any mutation?

  6. test: Cover AddrMan add edge cases
    Exercise empty and rejected batches, timestamp boundaries, penalties, source bucket stability, and tried address updates in AddrMan.
    02161b94df
  7. mertsaner force-pushed on Sep 12, 2026
  8. maflcko commented at 7:25 PM on September 17, 2026: member

    are you still wokring on this or can it be closed?

  9. DrahtBot added the label CI failed on Sep 18, 2026
  10. DrahtBot commented at 2:28 PM on September 18, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task NetBSD Cross: https://github.com/bitcoin/bitcoin/actions/runs/34676473518/job/105615469089</sub> <sub>LLM reason (✨ experimental): CI failed due to a build error: addrman_tests.cpp could not compile because CAddress was constructed with a uint64_t instead of the expected ServiceFlags argument (type mismatch).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  11. maflcko commented at 2:47 PM on September 18, 2026: member

    Probably ai slop that doesn't even compile and the llm bot is now offline

  12. maflcko closed this on Sep 18, 2026


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-09-22 05:51 UTC

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