-
Notifications
You must be signed in to change notification settings - Fork 0
Merge bitcoin/bitcoin#25073: test: Cleanup miner_tests #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: backport-0.25-batch-469
Are you sure you want to change the base?
Merge bitcoin/bitcoin#25073: test: Cleanup miner_tests #1214
Conversation
faa1552 test: Use dedicated mempool in TestBasicMining (MacroFake) fafab38 test: Use dedicated mempool in TestPackageSelection (MacroFake) fa4055d test: Use dedicated mempool in TestPrioritisedMining (MacroFake) fa29218 test: Pass mempool reference to AssemblerForTest (MacroFake) Pull request description: This cleans up the miner tests: * Removes duplicate/redundant and thus confusing chainparams object. * Uses a fresh mempool for each subtest instead of using the "global" one from the testing setup. This makes it easier to follow the tests in smaller scopes. Also it makes sure the mempool is truly cleared by reconstructing it. Finally, this removes calls to `clear`, see https://github.com/bitcoin/bitcoin#19909 ACKs for top commit: glozow: utACK faa1552 Tree-SHA512: ced1260f6ab70fba74b0fac7ff4fc7adfddcd2f3bee785249d2a4a9055ac253eff9090edbda7a17e72a71a81b56ff708d5ff64e1f57ebc7b7747d6c88fec51e3
WalkthroughThe pull request refactors the miner test infrastructure to use a per-test mempool instead of relying on a global Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)src/**/*.{cpp,h,cc,cxx,hpp}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/{test,wallet/test,qt/test}/**/*.{cpp,h,cc,cxx,hpp}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (5)📓 Common learnings📚 Learning: 2025-07-28T22:03:12.364ZApplied to files:
📚 Learning: 2025-07-28T20:34:29.061ZApplied to files:
📚 Learning: 2025-07-29T21:29:32.827ZApplied to files:
📚 Learning: 2025-07-28T23:09:09.522ZApplied to files:
🧬 Code graph analysis (1)src/test/miner_tests.cpp (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Remove incorrect braces that prematurely released cs_main lock - Ensure TestPackageSelection and TestPrioritisedMining run under cs_main lock - Matches Bitcoin commit 9eaa5db structure exactly This fixes thread-safety analysis errors on macOS build.
Verification Agent - Fixes AppliedIssue FoundThe backport incorrectly scoped the Root CauseIn Bitcoin commit 9eaa5dbc81, the The Dash backport incorrectly added braces around the lock scope: {
LOCK(cs_main);
TestBasicMining(scriptPubKey, txFirst, baseheight);
} // Lock released here - INCORRECT!
TestPackageSelection(scriptPubKey, txFirst); // Called without lock
TestPrioritisedMining(scriptPubKey, txFirst); // Called without lockFix AppliedRemoved the incorrect braces to match Bitcoin's structure: LOCK(cs_main);
TestBasicMining(scriptPubKey, txFirst, baseheight);
m_node.chainman->ActiveChain().Tip()->nHeight--;
SetMockTime(0);
TestPackageSelection(scriptPubKey, txFirst);
m_node.chainman->ActiveChain().Tip()->nHeight--;
SetMockTime(0);
TestPrioritisedMining(scriptPubKey, txFirst);Validation
CI will re-run to confirm the fix resolves the macOS build failure. Commit: 4a1108c |
Backports bitcoin#25073
Original commit: 9eaa5db
This cleans up the miner tests:
Dash-specific adaptations:
CheckSequenceLocksAtTip()bitcoin/bitcoin#23897🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.