pytest: show problem with pay when not enough HTLCs available.

As you can see, I did a lot of debugging before realizing that the
actual problem is in the pay plugin :(

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-05-28 13:23:28 +09:30
parent bf0320a53e
commit e619bf00fb
2 changed files with 42 additions and 15 deletions

View File

@@ -4,7 +4,7 @@ from fixtures import TEST_NETWORK
from flaky import flaky # noqa: F401
from pyln.client import RpcError, Millisatoshi
from pyln.proto.onion import TlvPayload
from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND
from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT
from utils import (
DEVELOPER, wait_for, only_one, sync_blockheight, TIMEOUT,
EXPERIMENTAL_FEATURES, env, VALGRIND
@@ -4292,3 +4292,13 @@ gives a routehint straight to us causes an issue
l3.stop()
with pytest.raises(RpcError, match=r'Destination .* is not reachable directly and all routehints were unusable'):
l2.rpc.pay(inv)
@pytest.mark.xfail(strict=True)
def test_pay_low_max_htlcs(node_factory):
"""Test we can pay if *any* HTLC slots are available"""
l1, l2, l3 = node_factory.line_graph(3,
opts={'max-concurrent-htlcs': 1},
wait_for_announce=True)
l1.rpc.pay(l3.rpc.invoice(FUNDAMOUNT * 50, "test", "test")['bolt11'])