Fixup TODO comment in feature_dbcrash.py; remove unnecessary sleep
Co-authored-by: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
1 file changed
+3
-4
@@ -76,8 +76,8 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
|
|||||||
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.
|
"""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
|
Exceptions during startup or subsequent RPC calls should indicate a node crash (due to -dbcrashratio), in which case we try again. Give up
|
||||||
after 60 seconds. Returns the utxo hash of the given node."""
|
after a timeout. Returns the utxo hash of the given node."""
|
||||||
|
|
||||||
time_start = time.time()
|
time_start = time.time()
|
||||||
while time.time() - time_start < 120:
|
while time.time() - time_start < 120:
|
||||||
@@ -93,12 +93,11 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
|
|||||||
# should raise an exception if bitcoind doesn't exit.
|
# should raise an exception if bitcoind doesn't exit.
|
||||||
self.wait_for_node_exit(node_index, timeout=10)
|
self.wait_for_node_exit(node_index, timeout=10)
|
||||||
self.crashed_on_restart += 1
|
self.crashed_on_restart += 1
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
# If we got here, bitcoind isn't coming back up on restart. Could be a
|
# 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 --
|
# bug in bitcoind, or we've gotten unlucky with our dbcrash ratio --
|
||||||
# perhaps we generated a test case that blew up our cache?
|
# 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.
|
# and make sure that recovery happens.
|
||||||
raise AssertionError(f"Unable to successfully restart node {node_index} in allotted time")
|
raise AssertionError(f"Unable to successfully restart node {node_index} in allotted time")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user