Skip to content

Commit 98dd4e7

Browse files
committed
Merge bitcoin/bitcoin#30006: test: use sleepy wait-for-log in reindex readonly
fd6a7d3 test: use sleepy wait-for-log in reindex readonly (Matthew Zipkin) Pull request description: Also rename the busy wait-for-log method to prevent recurrence. See bitcoin/bitcoin#27039 (comment) ACKs for top commit: maflcko: utACK fd6a7d3 achow101: ACK fd6a7d3 tdb3: ACK for fd6a7d3 rkrux: ACK [fd6a7d3](bitcoin/bitcoin@fd6a7d3) Tree-SHA512: 7ff0574833df1ec843159b35ee88b8bb345a513ac13ed0b72abd1bf330c454a3f9df4d927871b9e3d37bfcc07542b06ef63acef8e822cd18499adae8cbb0cda8
2 parents 24572cf + fd6a7d3 commit 98dd4e7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/functional/feature_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def check_clean_start():
8585

8686
for terminate_line in lines_to_terminate_after:
8787
self.log.info(f"Starting node and will exit after line {terminate_line}")
88-
with node.wait_for_debug_log([terminate_line]):
88+
with node.busy_wait_for_debug_log([terminate_line]):
8989
node.start(extra_args=['-txindex=1', '-blockfilterindex=1', '-coinstatsindex=1'])
9090
self.log.debug("Terminating node after terminate line was found")
9191
sigterm_node()

test/functional/feature_reindex_readonly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def reindex_readonly(self):
7575

7676
if undo_immutable:
7777
self.log.debug("Attempt to restart and reindex the node with the unwritable block file")
78-
with self.nodes[0].wait_for_debug_log([b"Reindexing finished"]):
78+
with self.nodes[0].assert_debug_log(["Reindexing finished"], timeout=60):
7979
self.start_node(0, extra_args=['-reindex', '-fastprune'])
8080
assert block_count == self.nodes[0].getblockcount()
8181
undo_immutable()

test/functional/test_framework/test_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2):
490490
self._raise_assertion_error('Expected messages "{}" does not partially match log:\n\n{}\n\n'.format(str(expected_msgs), print_log))
491491

492492
@contextlib.contextmanager
493-
def wait_for_debug_log(self, expected_msgs, timeout=60):
493+
def busy_wait_for_debug_log(self, expected_msgs, timeout=60):
494494
"""
495495
Block until we see a particular debug log message fragment or until we exceed the timeout.
496496
Return:

0 commit comments

Comments
 (0)