pytest: fix reconnect flake in test_route_by_old_scid
What changed, and why it matters
This is a one-line change to a test file that fixes an occasional test failure (a 'flake'). It swaps which test node initiates a connection after a restart to avoid a race where both nodes try to connect to each other at the same time. It does not change any production code or fix a security bug.
No security action needed. This is a test-only reliability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies tests/test_splicing.py in the Core Lightning repository. In test_route_by_old_scid, after restarting l2, the test previously had l2 call connect() to l1. Because l1 was already configured with l2’s address and would attempt to reconnect automatically, the two directions could collide, causing a ‘disconnected during connection’ error. The fix changes the test to have l1 call connect() to l2 instead, avoiding the simultaneous-connect race. No daemon, protocol, or library code is changed.
Changed components
tests/test_splicing.pyInspect captured patch +1 / −1
diff --git a/tests/test_splicing.py b/tests/test_splicing.py
index e5a3565b..f563ba17 100644
--- a/tests/test_splicing.py
+++ b/tests/test_splicing.py
@@ -551,7 +551,7 @@ def test_route_by_old_scid(node_factory, bitcoind):
# Now restart l2, make sure it remembers the original!
l2.restart()
- l2.rpc.connect(l1.info['id'], 'localhost', l1.port)
+ l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
wait_for(lambda: only_one(l1.rpc.listpeers()['peers'])['connected'] is True)
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.