pytest: fix test_sendpay_grouping regex.
What changed, and why it matters
This commit fixes a test-only regular expression so it correctly matches error messages that say 'after 10 attempts'. It is a test-suite maintenance change with no effect on the actual Core Lightning payment software or its users.
No security action needed. Treat as a normal test-fix commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change updates two pytest regex assertions in tests/test_pay.py from ‘[1-9]+’ to ‘[0-9]+’. The old regex rejected the digit ‘0’ in ‘10’, causing the test to fail when the payment code legitimately reported 10 routing attempts. This is purely a test expectation fix; no production code is modified.
Changed components
tests/test_pay.pyInspect captured patch +2 / −2
diff --git a/tests/test_pay.py b/tests/test_pay.py
index 1f31762c..d7012193 100644
--- a/tests/test_pay.py
+++ b/tests/test_pay.py
@@ -5234,7 +5234,7 @@ def test_sendpay_grouping(node_factory, bitcoind):
assert(len(l1.db.query("SELECT * FROM payments")) == 0)
assert(len(l1.rpc.listpays()['pays']) == 0)
- with pytest.raises(RpcError, match=r'Ran out of routes to try after [1-9]+ attempts'):
+ with pytest.raises(RpcError, match=r'Ran out of routes to try after [0-9]+ attempts'):
l1.rpc.pay(inv, amount_msat='100002msat')
# After this one invocation we have one entry in `listpays`
@@ -5246,7 +5246,7 @@ def test_sendpay_grouping(node_factory, bitcoind):
wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 6)
l3.stop()
- with pytest.raises(RpcError, match=r'Ran out of routes to try after [1-9]+ attempts'):
+ with pytest.raises(RpcError, match=r'Ran out of routes to try after [0-9]+ attempts'):
l1.rpc.pay(inv, amount_msat='100001msat')
# Surprise: we should have 2 entries after 2 invocations
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.