scripted-diff: Rename `WAIT_TIMEOUT` to `TEST_WAIT_TIMEOUT`
What changed, and why it matters
This commit renames a test-only constant from WAIT_TIMEOUT to TEST_WAIT_TIMEOUT because the old name conflicts with a Windows system macro. It is a build hygiene fix inside the test suite and does not change any production code or affect live Bitcoin network behavior.
No security action needed. Treat as a normal code-quality / portability patch.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is a scripted rename in src/test/threadpool_tests.cpp. On Windows, winerror.h defines WAIT_TIMEOUT as a preprocessor macro; if Windows headers are included before this test file, the macro expansion breaks compilation. Renaming to TEST_WAIT_TIMEOUT removes the name collision. No logic, timing, or runtime behavior is altered.
Changed components
src/test/threadpool_tests.cppInspect captured patch +3 / −3
diff --git a/src/test/threadpool_tests.cpp b/src/test/threadpool_tests.cpp
index 9af5348c..1100e876 100644
--- a/src/test/threadpool_tests.cpp
+++ b/src/test/threadpool_tests.cpp
@@ -21,7 +21,7 @@
// General test values
int NUM_WORKERS_DEFAULT = 0;
constexpr char POOL_NAME[] = "test";
-constexpr auto WAIT_TIMEOUT = 120s;
+constexpr auto TEST_WAIT_TIMEOUT = 120s;
struct ThreadPoolFixture {
ThreadPoolFixture() {
@@ -51,7 +51,7 @@ BOOST_FIXTURE_TEST_SUITE(threadpool_tests, ThreadPoolFixture)
#define WAIT_FOR(futures) \
do { \
for (const auto& f : futures) { \
- BOOST_REQUIRE(f.wait_for(WAIT_TIMEOUT) == std::future_status::ready); \
+ BOOST_REQUIRE(f.wait_for(TEST_WAIT_TIMEOUT) == std::future_status::ready); \
} \
} while (0)
@@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE(wait_for_task_to_finish)
UninterruptibleSleep(200ms);
flag.store(true, std::memory_order_release);
});
- BOOST_CHECK(future.wait_for(WAIT_TIMEOUT) == std::future_status::ready);
+ BOOST_CHECK(future.wait_for(TEST_WAIT_TIMEOUT) == std::future_status::ready);
BOOST_CHECK(flag.load(std::memory_order_acquire));
}
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.