tests: Improve stderr validation in test_runner.py #31966

pull GarmashAlex wants to merge 2 commits into bitcoin:master from GarmashAlex:104910 changing 1 files +5 −1
  1. GarmashAlex commented at 8:25 pm on February 28, 2025: none

    This PR implements the improvement suggested in a TODO comment in test/util/test_runner.py. It adds validation that stderr is empty when no errors are expected in test cases.

    The change adds a check that verifies stderr is empty when no error_txt is specified in the test object, with a special exception for bitcoin-tx running under Wine, which was mentioned in the original TODO comment.

    This improvement helps catch unexpected error messages that might otherwise go unnoticed during testing, making the test framework more robust.

    The implementation:

    1. Checks if stderr contains output when no error is expected
    2. Makes an exception for the known case of bitcoin-tx running under Wine
    3. Raises an exception with a detailed error message if unexpected stderr output is found

    This change improves test coverage by ensuring that tests don’t silently pass when they produce unexpected error output.

  2. Update test_runner.py a15bdf4efb
  3. DrahtBot commented at 8:25 pm on February 28, 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/31966.

    Reviews

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

  4. DrahtBot added the label Tests on Feb 28, 2025
  5. yancyribbens commented at 3:19 pm on March 10, 2025: contributor
    Is there any reason the TODO was not removed on L159 with this commit?
  6. Update test_runner.py c64c531388
  7. GarmashAlex commented at 5:28 pm on March 11, 2025: none
    @yancyribbens Sorry, my bad. I removed TODO
  8. fanquake marked this as a draft on Mar 12, 2025
  9. fanquake commented at 1:27 am on March 12, 2025: member

    Sorry, my bad. I removed TODO

    You partially removed it? You should also read https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#committing-patches in regards to fixing your commits messages & fixing your commits.

  10. maflcko commented at 8:15 am on March 12, 2025: member
  11. GarmashAlex commented at 4:57 pm on March 13, 2025: none
    @maflcko could i just create a new PR instead of this one . I don’t know how to squash commits

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-03-29 06:12 UTC

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