Fixup TODO comment in feature_dbcrash.py; remove unnecessary sleep
What changed, and why it matters
This is a minor cleanup change in a test script only. It rewords a comment, removes a one-second sleep, and extends the effective timeout from 60 to 120 seconds (the loop already used 120, but the docstring said 60). It does not touch production code, network behavior, or wallet handling, so it has no security relevance for Bitcoin users.
No security action needed. This is a test-only maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/feature_dbcrash.py. It updates a docstring to mention RPC-call exceptions and removes a hard-coded time.sleep(1) inside the restart retry loop. The loop condition already allowed up to 120 seconds; the docstring previously said 60 seconds, so the change also aligns the description with the code. No consensus, P2P, mempool, wallet, or cryptographic code is affected.
Changed components
test/functional/feature_dbcrash.pyInspect captured patch +3 / −4
diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py
index 2eb7bd07..7a60af40 100755
--- a/test/functional/feature_dbcrash.py
+++ b/test/functional/feature_dbcrash.py
@@ -76,8 +76,8 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
def restart_node(self, node_index, expected_tip):
"""Start up a given node id, wait for the tip to reach the given block hash, and calculate the utxo hash.
- Exceptions on startup should indicate node crash (due to -dbcrashratio), in which case we try again. Give up
- after 60 seconds. Returns the utxo hash of the given node."""
+ Exceptions during startup or subsequent RPC calls should indicate a node crash (due to -dbcrashratio), in which case we try again. Give up
+ after a timeout. Returns the utxo hash of the given node."""
time_start = time.time()
while time.time() - time_start < 120:
@@ -93,12 +93,11 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
# should raise an exception if bitcoind doesn't exit.
self.wait_for_node_exit(node_index, timeout=10)
self.crashed_on_restart += 1
- time.sleep(1)
# If we got here, bitcoind isn't coming back up on restart. Could be a
# bug in bitcoind, or we've gotten unlucky with our dbcrash ratio --
# perhaps we generated a test case that blew up our cache?
- # TODO: If this happens a lot, we should try to restart without -dbcrashratio
+ # If this happens, the test should try to restart without -dbcrashratio
# and make sure that recovery happens.
raise AssertionError(f"Unable to successfully restart node {node_index} in allotted time")
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.