diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py index b5b2f4e6b1b..693bc50aa8d 100755 --- a/test/functional/feature_dbcrash.py +++ b/test/functional/feature_dbcrash.py @@ -70,7 +70,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework): self.start_nodes() # Leave them unconnected, we'll use submitblock directly in this test - def restart_node(self, node_index, expected_tip): + 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 during startup or subsequent RPC calls should indicate a node crash (due to -dbcrashratio), in which case we try again. Give up @@ -139,7 +139,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework): # wait_for_node_exit() enforces that bitcoind crashed. self.wait_for_node_exit(i, timeout=30) self.log.debug(f"Restarting node {i} after block hash {block_hash}") - nodei_utxo_hash = self.restart_node(i, block_hash) + nodei_utxo_hash = self.restart_node(i, expected_tip=block_hash) assert nodei_utxo_hash is not None self.restart_counts[i] += 1 else: @@ -168,9 +168,9 @@ class ChainstateWriteCrashTest(BitcoinTestFramework): for i in range(3): try: nodei_utxo_hash = self.nodes[i].gettxoutsetinfo()['hash_serialized_3'] - except OSError: + except Exception: # probably a crash on db flushing - nodei_utxo_hash = self.restart_node(i, self.nodes[3].getbestblockhash()) + nodei_utxo_hash = self.restart_node(i, expected_tip=self.nodes[3].getbestblockhash()) assert_equal(nodei_utxo_hash, node3_utxo_hash) def generate_small_transactions(self, node, count, utxo_list):