mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 15:11:38 +00:00
test: Misc fixes for pending validation events races #36447
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!36447
Loading…
Reference in a new issue
No description provided.
Delete branch "2610-test-more-deterministic-TestChain100Setup"
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?
TestChain100Setupenqueues 100 validation events from blocks. Unit tests using that setup and their own validation events may run into non-determinism and even intermittent test failures.Fix all issues by draining the pending validation events in the ctor.
This can be tested with a diff like:
and then running the test
scan_for_wallet_transactions_attach_chaina few times.Or master (or the first commit), it should fail with:
error: scan_for_wallet_transactions_attach_chain": check wallet->mapWallet.size() == static_cast<size_t>(NEW_BLOCKS + 1) has failed [7 != 6].(Also included is a commit to move-only the many rescan tests to a separate file)
(Also included is a commit to fix unsafe index shutdowns in tests)
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.
LLM Linter (✨ experimental)
Possible typos and grammar issues:
src/wallet/test/rescan_tests.cpp:the one of the recorded best block→the coinbase of the recorded best block[the original phrasing is unclear]2026-10-07 10:42:25
Base:
9523d2b4a185c704994ef44d2229c3d1604cb9e5Head:
fa466dea808dedfc281cdff842cbefafae574d8aNo verified findings are available from this partial review.
Review coverage was incomplete. The archaeology review had incomplete evidence. The adversarial review did not complete. The adversarial_glm review did not complete. The design review had incomplete evidence.
Full review report
ACK
9999557b77ACK
9999557b77Nice!
Hmm, looks like Ralph Review found another race. To repo:
Let me push a fix for that as well ...
ok, now the CI is failing because there is another UB race :(
Let's fix that here as well, I guess ...
🚧 At least one of the CI tasks failed.
Task
TSan: https://github.com/bitcoin/bitcoin/actions/runs/37524113100/job/112476629653LLM reason (✨ experimental): CI failed because ThreadSanitizer detected a data race on a vptr in
BaseIndex::~BaseIndex()duringcoinstatsindex_tests.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
Code review ACK
fa77f27f98Minor comments below
Perhaps it may be better to just drain in mineBlock? That way other callers that will mine a block get the notification emitted for free, without them having to drain themselves?
Same comment here: can we move the drain to CreateAndProcessBlock?
I was thinking that it could be useful coverage for the unit tests to be async here. But then, I don't know if they have ever found an issue here. Of course, we still need the option to be async, but maybe it is fine to sync by default.
I'll push that ...
reACK
fa10ab5fdbWhat about the other cases of
txindex.Stop()in this file? I guess most don't produce more blocks, but the last test for example does, so maybe we should also sync there?ah, I only grepped for the comment. Fixed the others as well now.
ACK
fa466dea80reACK
fa466dea80Tested ACK
I agree, this will sure help to prevents flaky test failures.
built and verified changes, all 862 unit test cases in test_bitcoin passed cleanly.