pytest: fix flake in test_route_by_old_scid
What changed, and why it matters
This is a one-line change to a test file only. It fixes an occasional test failure (a 'flake') by adding a larger safety margin for a timing-related value in a Lightning payment route. There is no change to production code, no security fix, and no vulnerability.
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 commit modifies tests/test_splicing.py in the Core Lightning repository. The test test_route_by_old_scid was intermittently failing because the computed CLTV (checklocktimeverify) expiry in the route was too close to the current block height, causing the remote node to reject the payment with WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS and ‘Expiry cltv too soon’. The fix explicitly passes cltv=16 to getroute, increasing the final CLTV delta so the route remains valid as blocks advance during test execution. No C-lightning daemon 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 aed5061c..4974b914 100644
--- a/tests/test_splicing.py
+++ b/tests/test_splicing.py
@@ -506,7 +506,7 @@ def test_route_by_old_scid(node_factory, bitcoind):
# Get pre-splice route.
inv = l3.rpc.invoice(10000000, 'test_route_by_old_scid', 'test_route_by_old_scid')
inv2 = l3.rpc.invoice(10000000, 'test_route_by_old_scid2', 'test_route_by_old_scid2')
- route = l1.rpc.getroute(l3.info['id'], 10000000, 1)['route']
+ route = l1.rpc.getroute(l3.info['id'], 10000000, 1, cltv=16)['route']
# Do a splice
funds_result = l2.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
Why this scored 14/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.