test: scale IPC mining wait timeouts by timeout_factor
What changed, and why it matters
This commit only adjusts timeout values in a single automated test file. It makes the test wait longer under slow CI conditions to avoid false failures. There is no change to the actual Bitcoin Core software that users run, and no security issue is present.
No security action needed. This is a routine test-maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies test/functional/interface_ipc_mining.py to multiply hardcoded IPC mining wait timeouts by self.options.timeout_factor, or to use a minimum of 60 seconds for long waits. This is a test-only robustness fix for slow CI environments (sanitizers, high parallelism). It does not touch production code, consensus logic, networking, wallet handling, or any user-facing behavior.
Changed components
test/functional/interface_ipc_mining.pyInspect captured patch +4 / −4
diff --git a/test/functional/interface_ipc_mining.py b/test/functional/interface_ipc_mining.py
index 0c3b9cf8..31ccec63 100755
--- a/test/functional/interface_ipc_mining.py
+++ b/test/functional/interface_ipc_mining.py
@@ -110,7 +110,7 @@ class IPCMiningTest(BitcoinTestFramework):
"""Test Mining interface methods."""
self.log.info("Running Mining interface test")
block_hash_size = 32
- timeout = 1000.0 # 1000 milliseconds
+ timeout = 1000.0 * self.options.timeout_factor # 1000 milliseconds
async def async_routine():
ctx, mining = await make_mining_ctx(self)
@@ -132,7 +132,7 @@ class IPCMiningTest(BitcoinTestFramework):
self.log.debug("interrupt() should abort waitTipChanged()")
async def wait_for_tip():
- long_timeout = 60000.0 # 1 minute
+ long_timeout = max(timeout, 60000.0) # at least 1 minute
result = (await mining.waitTipChanged(ctx, newblockref.hash, long_timeout)).result
# Unlike a timeout, interrupt() returns an empty BlockRef.
assert_equal(len(result.hash), 0)
@@ -172,7 +172,7 @@ class IPCMiningTest(BitcoinTestFramework):
"""Test BlockTemplate interface methods."""
self.log.info("Running BlockTemplate interface test")
block_header_size = 80
- timeout = 1000.0 # 1000 milliseconds
+ timeout = 1000.0 * self.options.timeout_factor
async def async_routine():
ctx, mining = await make_mining_ctx(self)
@@ -285,7 +285,7 @@ class IPCMiningTest(BitcoinTestFramework):
self.log.debug("interruptWait should abort the current wait")
async def wait_for_block():
new_waitoptions = self.capnp_modules['mining'].BlockWaitOptions()
- new_waitoptions.timeout = timeout * 60 # 1 minute wait
+ new_waitoptions.timeout = max(timeout, 60000.0) # at least 1 minute
new_waitoptions.feeThreshold = 1
template7 = await mining_wait_next_template(template6, stack, ctx, new_waitoptions)
assert template7 is None
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.