test: refactor: Remove confusing ignore_errors=True #36065

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2608-test-less-ignore_errors-True changing 1 files +7 −8
  1. maflcko commented at 12:37 PM on August 24, 2026: member

    There is an unexplained ignore_errors=True in the internal _initialize_chain helper:

    
    shutil.rmtree(cache_path('fees'), ignore_errors=True)
    

    This is fine, because no error should happen. But it is a bit confusing, because an ignored error may lead to a later error anyway.

    Fix that by failing early instead.

    Also, re-write the simple block to pathlib.

  2. DrahtBot added the label Tests on Aug 24, 2026
  3. DrahtBot commented at 12:37 PM on August 24, 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/36065.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK willcl-ark
    Stale ACK jeanpablojp

    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. jeanpablojp commented at 3:07 PM on August 27, 2026: contributor

    tACK fa43bb80f5e2bb0755fbf38463040c537ec507f6

    fees only goes missing under -blocksonly, which the cache node never gets.

  5. in test/functional/test_framework/test_framework.py:964 in fa43bb80f5
     967 | -            os.rmdir(cache_path('wallets'))  # Remove empty wallets dir
     968 | -            shutil.rmtree(cache_path('fees'), ignore_errors=True)
     969 | -            for entry in os.listdir(cache_path()):
     970 | -                if entry not in ['chainstate', 'blocks', 'indexes']:  # Only indexes, chainstate and blocks folders
     971 | -                    os.remove(cache_path(entry))
     972 | +            cache_path = Path(cache_node_dir) / self.chain
    


    jeanpablojp commented at 3:07 PM on August 27, 2026:

    nit: get_datadir_path already returns a pathlib.Path, so this could drop the Path()? (feel free to ignore)


    maflcko commented at 4:36 PM on August 27, 2026:

    thx, done

  6. fanquake requested review from willcl-ark on Aug 27, 2026
  7. test: refactor: Remove confusing ignore_errors=True fa7be0a8df
  8. maflcko force-pushed on Aug 27, 2026
  9. willcl-ark approved
  10. willcl-ark commented at 8:26 AM on September 1, 2026: member

    ACK fa7be0a8df9d99d4dd880afb4f48a9b197dca5b0

    Can't work out why this might have been added originally, but agree we don't want it here.

  11. DrahtBot requested review from jeanpablojp on Sep 1, 2026
  12. fanquake merged this on Sep 1, 2026
  13. fanquake closed this on Sep 1, 2026

  14. jeanpablojp commented at 9:14 AM on September 1, 2026: contributor

    re-ACK fa7be0a8df9d99d4dd880afb4f48a9b197dca5b0

  15. maflcko deleted the branch on Sep 1, 2026


jeanpablojp

Labels

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-09 07:56 UTC