From fadb77169bed77e0df8d42d55599615b916ee6e8 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Mon, 16 Feb 2026 10:44:28 +0100 Subject: [PATCH] test: Scale feature_dbcrash.py timeout with factor This allows to run the test under valgrind: ./bld-cmake/test/functional/feature_dbcrash.py --timeout-factor=10 --valgrind For testing, the same test can be run multiple times in parallel: ./bld-cmake/test/functional/test_runner.py -j 10 $( printf 'feature_dbcrash.py %.0s' {1..10} ) --timeout-factor=10 --valgrind (Running the test under valgrind may take several hours!) I found that before this commit, 9 out of the 10 runs failed via: ``` ... TestFramework (INFO): Iteration 36, generating 2500 transactions [11, 5, 6] TestFramework (ERROR): Unexpected exception Traceback (most recent call last): File "/b-c/test/functional/test_framework/test_framework.py", line 142, in main self.run_test() ~~~~~~~~~~~~~^^ File "/b-c/bld-cmake/test/functional/feature_dbcrash.py", line 262, in run_test self.sync_node3blocks(block_hashes) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/b-c/bld-cmake/test/functional/feature_dbcrash.py", line 151, in sync_node3blocks nodei_utxo_hash = self.restart_node(i, block_hash) File "/b-c/bld-cmake/test/functional/feature_dbcrash.py", line 102, in restart_node raise AssertionError(f"Unable to successfully restart node {node_index} in allotted time") AssertionError: Unable to successfully restart node 0 in allotted time ``` With this commit, all 10 runs passed. --- test/functional/feature_dbcrash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py index 7a60af40f49..cc94be781d1 100755 --- a/test/functional/feature_dbcrash.py +++ b/test/functional/feature_dbcrash.py @@ -80,7 +80,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework): after a timeout. Returns the utxo hash of the given node.""" time_start = time.time() - while time.time() - time_start < 120: + while time.time() - time_start < 120 * self.options.timeout_factor: try: # Any of these RPC calls could throw due to node crash self.start_node(node_index)