Merge bitcoin/bitcoin#34581: test: Set assert_debug_log timeout to 0
fa4cb96bdetest: Set assert_debug_log timeout to 0 (MarcoFalke) Pull request description: The `assert_debug_log` helper is meant to be a context manager. However, it has a default timeout of 2 seconds, and can act as a silent polling/wait/sync function. This is confusing and brittle, and leads to intermittent bugs such as https://github.com/bitcoin/bitcoin/pull/34571. Fix all issues, by setting the default timeout to zero. Then adjust all call sites to either use this correctly like a context manager, or adjust them explicitly to specify a timeout, to document that this is a polling sync function. ACKs for top commit: hodlinator: re-ACKfa4cb96bdebrunoerg: ACKfa4cb96bdeTree-SHA512: 111a45c84327c3afea98fd9f8de13dd7d11969b2309471b4ad21694b290a3734f6e1eda75a41b39613b0995c5b7075298085cea2ca06aa07d4385eb8d72fe95b
This commit is contained in:
13 files changed
+46
-35
No files matched your search
@@ -550,7 +550,7 @@ class TestNode():
|
||||
return dl.tell()
|
||||
|
||||
@contextlib.contextmanager
|
||||
def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2):
|
||||
def assert_debug_log(self, expected_msgs, unexpected_msgs=None, *, timeout=0):
|
||||
if unexpected_msgs is None:
|
||||
unexpected_msgs = []
|
||||
assert_equal(type(expected_msgs), list)
|
||||
|
||||
Reference in new issue
Block a user