test: use ForkGenerator to deduplicate reorg test code #33959

pull yuvicc wants to merge 1 commits into bitcoin:master from yuvicc:2025-11-followup_fix_reorgs_tests changing 7 files +166 −108
  1. yuvicc commented at 5:49 am on November 27, 2025: contributor

    Deduplicate reorg test code by introducing ForkGenerator utility class in blocktools.py.

    Changes

    • Add ForkGenerator class with prepare_fork() / trigger_reorg() / reset() methods
    • Removes duplicated trigger_reorg() methods across tests
    • Update mempool tests to use the new utility

    For now I am keeping it as draft as we need to address other tests to eliminate use of invalidate_block for reorg scenario. Also, optional args for non-empty forks to test mix-and-match cases of transactions re-entering mempool as suggested by instagibbs in #32587 (comment).

  2. test: use ForkGenerator to deduplicate reorg test code
    Replace duplicated trigger_reorg() methods in mempool tests with ForkGenerator utility class in blocktools.py.
    4e082198d3
  3. DrahtBot added the label Tests on Nov 27, 2025
  4. DrahtBot commented at 5:49 am on November 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/33959.

    Reviews

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #33616 (policy: don’t CheckEphemeralSpends on reorg by instagibbs)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  5. fanquake requested review from instagibbs on Nov 27, 2025
  6. fanquake renamed this:
    test: use ForkGenerator to deduplicate reorg test code (#32587 follow-up)
    test: use ForkGenerator to deduplicate reorg test code
    on Nov 27, 2025


yuvicc DrahtBot


instagibbs

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-12-01 21:13 UTC

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