test: Use BasicTestingSetup when TestingSetup is not necessary
What changed, and why it matters
This commit only changes Bitcoin Core's internal unit tests. It swaps a heavier test helper (TestingSetup) for a lighter one (BasicTestingSetup) in six test files where the full setup was unnecessary. There is no change to the actual Bitcoin node software that users run, so it cannot affect live networks, wallets, or transactions.
No security action required. Treat as a normal test-maintenance refactor. Reviewers may optionally confirm that none of the affected tests rely on TestingSetup-specific state.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch refactors test fixtures: BOOST_FIXTURE_TEST_SUITE and a custom NoLockLoggingTestingSetup now inherit from BasicTestingSetup instead of TestingSetup. TestingSetup typically initializes more global state (e.g., a full chainstate/validation environment), while BasicTestingSetup is cheaper. The affected tests (checkqueue, merkle, orphanage, prevector, rbf, validation) do not appear to need the heavier fixture. This is a test-only cleanup with no production code modifications.
Changed components
src/test/checkqueue_tests.cppsrc/test/merkle_tests.cppsrc/test/orphanage_tests.cppsrc/test/prevector_tests.cppsrc/test/rbf_tests.cppsrc/test/validation_tests.cppInspect captured patch +9 / −9
diff --git a/src/test/checkqueue_tests.cpp b/src/test/checkqueue_tests.cpp
index 2d13a267..3e2fc83f 100644
--- a/src/test/checkqueue_tests.cpp
+++ b/src/test/checkqueue_tests.cpp
@@ -21,16 +21,16 @@
#include <vector>
/**
- * Identical to TestingSetup but excludes lock contention logging if
+ * Identical to BasicTestingSetup but excludes lock contention logging if
* `DEBUG_LOCKCONTENTION` is defined, as some of these tests are designed to be
* heavily contested to trigger race conditions or other issues.
*/
-struct NoLockLoggingTestingSetup : public TestingSetup {
+struct NoLockLoggingTestingSetup : public BasicTestingSetup {
NoLockLoggingTestingSetup()
#ifdef DEBUG_LOCKCONTENTION
- : TestingSetup{ChainType::MAIN, {.extra_args = { "-debugexclude=lock" } }} {}
+ : BasicTestingSetup{ChainType::MAIN, {.extra_args = { "-debugexclude=lock" } }} {}
#else
- : TestingSetup{ChainType::MAIN} {}
+ : BasicTestingSetup{ChainType::MAIN} {}
#endif
};
diff --git a/src/test/merkle_tests.cpp b/src/test/merkle_tests.cpp
index a7212147..a6dd23ad 100644
--- a/src/test/merkle_tests.cpp
+++ b/src/test/merkle_tests.cpp
@@ -9,7 +9,7 @@
#include <boost/test/unit_test.hpp>
-BOOST_FIXTURE_TEST_SUITE(merkle_tests, TestingSetup)
+BOOST_FIXTURE_TEST_SUITE(merkle_tests, BasicTestingSetup)
static uint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vector<uint256>& vMerkleBranch, uint32_t nIndex) {
uint256 hash = leaf;
diff --git a/src/test/orphanage_tests.cpp b/src/test/orphanage_tests.cpp
index 6ebfab34..1f303993 100644
--- a/src/test/orphanage_tests.cpp
+++ b/src/test/orphanage_tests.cpp
@@ -20,7 +20,7 @@
#include <boost/test/unit_test.hpp>
-BOOST_FIXTURE_TEST_SUITE(orphanage_tests, TestingSetup)
+BOOST_FIXTURE_TEST_SUITE(orphanage_tests, BasicTestingSetup)
static void MakeNewKeyWithFastRandomContext(CKey& key, FastRandomContext& rand_ctx)
{
diff --git a/src/test/prevector_tests.cpp b/src/test/prevector_tests.cpp
index 4b63e76f..f9dcaae0 100644
--- a/src/test/prevector_tests.cpp
+++ b/src/test/prevector_tests.cpp
@@ -13,7 +13,7 @@
#include <ranges>
#include <vector>
-BOOST_FIXTURE_TEST_SUITE(prevector_tests, TestingSetup)
+BOOST_FIXTURE_TEST_SUITE(prevector_tests, BasicTestingSetup)
template <unsigned int N, typename T>
class prevector_tester
diff --git a/src/test/rbf_tests.cpp b/src/test/rbf_tests.cpp
index 0ffe0846..e2a95148 100644
--- a/src/test/rbf_tests.cpp
+++ b/src/test/rbf_tests.cpp
@@ -14,7 +14,7 @@
#include <optional>
#include <vector>
-BOOST_FIXTURE_TEST_SUITE(rbf_tests, TestingSetup)
+BOOST_FIXTURE_TEST_SUITE(rbf_tests, BasicTestingSetup)
static inline CTransactionRef make_tx(const std::vector<CTransactionRef>& inputs,
const std::vector<CAmount>& output_values)
diff --git a/src/test/validation_tests.cpp b/src/test/validation_tests.cpp
index 80f32897..b1e204f1 100644
--- a/src/test/validation_tests.cpp
+++ b/src/test/validation_tests.cpp
@@ -19,7 +19,7 @@
#include <boost/test/unit_test.hpp>
-BOOST_FIXTURE_TEST_SUITE(validation_tests, TestingSetup)
+BOOST_FIXTURE_TEST_SUITE(validation_tests, BasicTestingSetup)
static void TestBlockSubsidyHalvings(const Consensus::Params& consensusParams)
{
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.