test: Wait for index sync in wallet_fast_rescan.py #36618

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2610-test-index-wallet-sync changing 18 files +41 −71
  1. maflcko commented at 8:49 AM on October 23, 2026: member

    Fixes #36564 by adding the missing wait on the index sync.

    Diff to reproduce:

    diff --git a/src/util/thread.cpp b/src/util/thread.cpp
    index 5b20e807b4..2e988c9eea 100644
    --- a/src/util/thread.cpp
    +++ b/src/util/thread.cpp
    @@ -8,2 +8,3 @@
     #include <util/log.h>
    +#include <util/time.h>
     #include <util/threadnames.h>
    @@ -17,2 +18,3 @@ void util::TraceThread(std::string_view thread_name, std::function<void()> threa
         util::ThreadRename(std::string{thread_name});
    +    UninterruptibleSleep(999ms);
         try {
    

    On failure, the log will say something like:

     - 2026-10-18T05:06:44.451973Z [http.01] [wallet/scan.cpp:142] [ShouldFetchBlock] [scan] Fast rescan: inspect block 200 [4c063a93914ec0cb1604297f2f601dab9b9342bf073e6b80e1c11efd71714e2e] (WARNING: block filter not found!)
    
  2. test: Wait for index sync in wallet_fast_rescan.py fa8009ba29
  3. DrahtBot added the label Tests on Oct 23, 2026
  4. DrahtBot commented at 8:49 AM on October 23, 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
    Concept ACK ViniciusCestarii

    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.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36629 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36629.svg"></sub> (Add output script index and corresponding script history RPC by andrewtoth)
    • #36598 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36598.svg"></sub> ([Demo] validation: remove AssumeUTXO by l0rinc)
    • #36292 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36292.svg"></sub> (index: Delete old coinstats index directory on startup by fjahr)
    • #36257 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36257.svg"></sub> (qa: assert_equals -> assert_true/assert_false by hodlinator)
    • #36002 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36002.svg"></sub> (txindex: allow running in pruned mode by andrewtoth)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. test: refactor: Wait for index sync by default
    The tests already wait for the mempool and blocks after start and after
    mining, so they should wait for indexes as well to avoid intermittent
    test failures.
    
    This refactor does not change any test behavior.
    fa74dc72d9
  6. maflcko commented at 1:11 PM on October 23, 2026: member

    It seems a bit tedious to find and fix all of those issues by hand. Also, the tests will become overly verbose with all the manual syncs.

    The framework should do this by itself, so I pushed that refactor and removed all of the manual syncs in tests.

  7. in test/functional/feature_index_prune.py:1 in fa74dc72d9


    ViniciusCestarii commented at 4:31 PM on October 29, 2026:

    In "test: refactor: Wait for index sync by default" fa74dc72d942e1628cea3c143bb56eed1457bbce

    This changes test behavior. It used to check for absolute height and missing index.

  8. ViniciusCestarii commented at 4:46 PM on October 29, 2026: contributor

    Concept ACK, I like how cleaner it is. I also measured performance but saw no significant change.

    Commented a test that loses coverage with these changes.


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-10-30 09:40 UTC