test: Add missing self.options.timeout_factor scale in tool_bitcoin_chainstate.py
What changed, and why it matters
This is a minor test-only fix. It makes a Bitcoin Core functional test respect the configurable timeout factor when waiting for a helper tool to respond, and makes two function arguments require explicit names. It does not change the actual Bitcoin node software or introduce any security issue.
No security action needed. Treat as ordinary test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies test/functional/tool_bitcoin_chainstate.py only. It multiplies a hard-coded 5-second subprocess timeout by self.options.timeout_factor so slow test environments (e.g., valgrind, sanitizers) can scale timeouts. It also forces expected_stderr and expected_stdout to be keyword-only arguments and adds a trailing comma. No production code is affected.
Changed components
test/functional/tool_bitcoin_chainstate.pyInspect captured patch +3 / −3
diff --git a/test/functional/tool_bitcoin_chainstate.py b/test/functional/tool_bitcoin_chainstate.py
index 8f33da35..c57da1fc 100755
--- a/test/functional/tool_bitcoin_chainstate.py
+++ b/test/functional/tool_bitcoin_chainstate.py
@@ -51,15 +51,15 @@ class BitcoinChainstateTest(BitcoinTestFramework):
assert_equal(n0.getbestblockhash(), SNAPSHOT_BASE_BLOCK_HASH)
return n0.dumptxoutset('utxos.dat', "latest")
- def add_block(self, datadir, input, expected_stderr=None, expected_stdout=None):
+ def add_block(self, datadir, input, *, expected_stderr=None, expected_stdout=None):
proc = subprocess.Popen(
self.get_binaries().chainstate_argv() + ["-regtest", datadir],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- text=True
+ text=True,
)
- stdout, stderr = proc.communicate(input=input + "\n", timeout=5)
+ stdout, stderr = proc.communicate(input=input + "\n", timeout=5 * self.options.timeout_factor)
self.log.debug("STDOUT: {0}".format(stdout.strip("\n")))
self.log.info("STDERR: {0}".format(stderr.strip("\n")))
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.