pytest: fix flake in test_connect_ratelimit
What changed, and why it matters
This commit fixes a flaky test in the project's automated test suite. The test sometimes failed because it intentionally paused nodes during reconnection, which could cause harmless timing warnings in the logs. The fix tells the test framework to ignore those specific warnings instead of treating them as test failures. There is no security issue here.
No security action needed. This is a test-only change improving CI reliability.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change modifies test_connect_ratelimit in tests/test_connection.py. The test uses SIGSTOP to pause nodes during reconnection, which can cause connectd to log ‘wake delay for WIRE_CHANNEL_REESTABLISH’ messages at BROKEN level. The fix adds ‘broken_log’: ‘connectd: wake delay for’ to the expected log filters for the five peer nodes, preventing these timing-related warnings from failing the test. This is purely a test reliability fix.
Changed components
tests/test_connection.pytest_connect_ratelimitInspect captured patch +4 / −1
diff --git a/tests/test_connection.py b/tests/test_connection.py
index bc609cfd..05724c51 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -4719,8 +4719,11 @@ def test_injectonionmessage(node_factory):
def test_connect_ratelimit(node_factory, bitcoind):
"""l1 has 5 peers, restarts, make sure we limit"""
+ # Sending nodes SIGSTOP at the wrong time makes connectd complain about
+ # how long operations took!
nodes = node_factory.get_nodes(6,
- opts=[{'dev-limit-connections-inflight': None, 'may_reconnect': True}] + [{'may_reconnect': True}] * 5)
+ opts=[{'dev-limit-connections-inflight': None, 'may_reconnect': True}]
+ + [{'may_reconnect': True, 'broken_log': "connectd: wake delay for"}] * 5)
l1 = nodes[0]
nodes = nodes[1:]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.