mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 09:38:38 +00:00
test: Wait for index sync in all tests #36618
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36618
Loading…
Reference in a new issue
No description provided.
Delete branch "2610-test-index-wallet-sync"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes https://github.com/bitcoin/bitcoin/issues/36564 by adding the missing wait on the index sync.
Diff to reproduce:
Command to reproduce (run twice to create the cache the first time, and reproduce on the second):
On failure, the log will say something like:
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
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.
🟠 Minor · Startup index wait shortens the pruning test’s catch-up timeout
feature_index_prune.py:124 restarts the indexed nodes, and startup now waits for index sync inside wait_for_rpc_connection (test_node.py:385) using the default 60s timeout. Base allowed node 1's coinstatsindex 150s to catch up from height 754 to 1500, so a catch-up of 60–150s now fails at restart.
Location:
test/functional/feature_index_prune.py:117(head).Review coverage was incomplete.
Reviewed:
fa74dc72d942· Full review report · Previous reportspermalink
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.
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.
In "test: refactor: Wait for index sync by default"
fa74dc72d9This changes test behavior. It used to check for absolute height and missing index.
I don't think it does change behavior. The implicit sync will use
getblockcountas the absolute height, just like the test used the height before.Also, the test calls RPCs to fetch the index data, so if an index was missing, the test would fail, just like before.
thanks for explaining! Makes sense.
ACK
fa74dc72d9I’m not sure this is the right reproducer, as all the tests pass on my Ubuntu 26.04 machine.
UPDATE. A bit unrelated to this PR, but that reproducer with a longer sleep triggered the following tests on my machine:
UPDATE 2. Only
tool_utxo_to_sqlite.pyseems to have an issue, as others pass with the proper--timeout-factor.UPDATE 3. A clanker's fix:
Sorry, I forgot to clarify this only reproduces when running the test stand-alone and on the second run, because it needs the cache.
I don't understand. The pull request here is supposed to fix the all index sync test issue (and I've confirmed this locally for tool_utxo_to_sqlite.py as well). Can you try this again and confirm you tested this pull?
I was able to reproduce the issue using a longer delay on another machine of mine, running Fedora 44.
Yes, I can confirm that I have been testing this PR yesterday and today :)
It indeed fixes
tool_utxo_to_sqlite.pyas well. But the fix comes in the second commit. Its commit message reads "This refactor does not change any test behavior", but there is evidence that it is a fix rather than a pure refactor.To summarise, the extra delay in
src/util/thread.cppreliably triggers failures in bothwallet_fast_rescan.pyandtool_utxo_to_sqlite.py. The second commit fixes all of them. So is the first commit needed at all?I wasn't aware that other tests also need fixing and when I wrote this, it was meant as a hardening refactor. I don't think there is much value in spending too much time enumerating all tests that are fixed. This also fixes https://github.com/bitcoin/bitcoin/pull/35728#discussion_r4424117298 and I am sure it fixes a bunch of others more.
Happy to squash or reword the commit msg, but the overall diff won't change, so I am not sure if this is worth the review churn.
ACK
fa74dc72d9, the changes are correct.You are right about the overall diff. However, I'd be happy to re-ACK if you change your mind about the imprecise commit message.