pytest: fix flake in test_reconnect_remote_sends_no_sigs
What changed, and why it matters
This commit fixes a flaky test by sorting log messages before comparing them. The test was failing because two network messages could arrive in either order. There is no change to production code and no security issue.
No security action needed. Treat as a normal test reliability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies tests/test_connection.py in test_reconnect_remote_sends_no_sigs. It replaces an exact-order assertion on two log entries (‘peer_out’, ‘peer_in’) with a sorted comparison ([‘peer_in’, ‘peer_out’]). This is purely a test robustness fix; no Core Lightning runtime code is changed.
Changed components
tests/test_connection.pyInspect captured patch +1 / −1
diff --git a/tests/test_connection.py b/tests/test_connection.py
index 0671b958..9a3a99f9 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -979,7 +979,7 @@ def test_reconnect_remote_sends_no_sigs(node_factory):
l2.daemon.wait_for_log('peer_out WIRE_ANNOUNCEMENT_SIGNATURES')
l1msgs = [l.split()[4] for l in l1.daemon.logs[l1needle:] if 'WIRE_ANNOUNCEMENT_SIGNATURES' in l]
- assert l1msgs == ['peer_out', 'peer_in']
+ assert sorted(l1msgs) == ['peer_in', 'peer_out']
# l2 only sends one.
assert len([l for l in l2.daemon.logs[l2needle:] if 'peer_out WIRE_ANNOUNCEMENT_SIGNATURES' in l]) == 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.