test: handle mainnet logs in `combine_logs.py` #36982

pull l0rinc wants to merge 1 commits into bitcoin:master from l0rinc:l0rinc/combine-logs-mainnet changing 1 files +1 −1
  1. l0rinc commented at 2:10 PM on November 25, 2026: contributor

    Problem: Running combine_logs.py on the logs from a mainnet functional test such as rpc_validateaddress.py raises AttributeError. The helper expects a path like node0/regtest/debug.log, but mainnet writes node0/debug.log.

    Before #16973, the helper silently skipped the mainnet log. That PR made the search recursive, so it finds the log and then fails when the regex tries to extract a subdirectory.

    Fix: Get the log directory relative to node0/ from the path the script already found.

    <details> <summary>Manual reproducer</summary>

    From the repository root with a functional-test build:

    dir=$(mktemp -d)
    build/test/functional/rpc_validateaddress.py --tmpdir="$dir/run" --nocleanup
    test/functional/combine_logs.py "$dir/run"
    

    The address-validation test passes. Before the fix, the last command fails in read_logs():

      File "test/functional/combine_logs.py", line 88, in read_logs
        chain = re.search(r'node0/(.+?)/debug\.log$', debug_logs[0].as_posix()).group(1)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'group'
    

    With the fix, the same command prints both the test and node0 log entries in timestamp order.

    </details>

  2. DrahtBot added the label Tests on Nov 25, 2026
  3. DrahtBot commented at 2:10 PM on November 25, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK maflcko, mzumsande

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. test: handle mainnet logs in combine_logs.py
    Mainnet functional tests write debug.log directly under node0/.
    The helper used to skip that log, but since #16973, the recursive glob finds it, but the regex still expects a chain subdirectory and raises AttributeError.
    
    Derive the relative directory from the discovered path so the helper can include the mainnet node log in its output.
    4e1dc2e015
  5. l0rinc force-pushed on Nov 25, 2026
  6. fanquake commented at 2:14 PM on November 25, 2026: member

    If this is broken, that seems like more reason to remove entirely, rather than fix: #36958 (comment).

  7. l0rinc commented at 3:18 PM on November 25, 2026: contributor

    If this is broken, that seems like more reason to remove entirely, rather than fix: #36958 (comment).

    Was wondering about the same, closing and +1 for removal

  8. l0rinc closed this on Nov 25, 2026

  9. maflcko commented at 3:33 PM on November 25, 2026: member

    lgtm ACK 4e1dc2e01511ef9328a54fbbf756cb8c159898a7

  10. maflcko commented at 3:35 PM on November 25, 2026: member

    This is used by the test runner, it can't be removed:

    test/functional/test_runner.py:                    combined_logs_args = [sys.executable, os.path.join(tests_dir, 'combine_logs.py'), testdir]
    
  11. fanquake reopened this on Nov 25, 2026

  12. fanquake added the label Needs Backport (32.x) on Nov 25, 2026
  13. fanquake commented at 4:17 PM on November 25, 2026: member

    Yea, sorry. This can be fixed (and backported).

  14. mzumsande commented at 4:27 PM on November 25, 2026: contributor

    Code Review ACK 4e1dc2e01511ef9328a54fbbf756cb8c159898a7

    I use combine_logs.py often, but apparently never with a mainnet test.

    Special constellations such as feature_config_args.py (multiple chains for one node) and wallet_crosschain.py (mixed chains) will still not behave ideally, but I don't think this is worth fixing - it seems good enough for me.

  15. fanquake merged this on Nov 25, 2026
  16. fanquake closed this on Nov 25, 2026

  17. fanquake removed the label Needs Backport (32.x) on Nov 25, 2026
  18. fanquake commented at 6:04 PM on November 25, 2026: member

    Backported to 32.x in #36984.


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-11-30 04:51 UTC

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