Skip to content

Commit

Permalink
pytest: Reproduce waitblockheight timeout issue ElementsProject#4309
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Jan 6, 2021
1 parent 70388cc commit 9224cf2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -3933,3 +3933,20 @@ def test_fetchinvoice(node_factory, bitcoind):
l1.rpc.call('fetchinvoice', {'offer': offer,
'recurrence_counter': 2,
'recurrence_label': 'test recurrence'})


def test_pay_waitblockheight_timeout(node_factory, bitcoind):
plugin = os.path.join(os.path.dirname(__file__), 'plugins', 'endlesswaitblockheight.py')
l1, l2 = node_factory.line_graph(2, opts=[{}, {'plugin': plugin}])

sync_blockheight(bitcoind, [l1, l2])
inv = l2.rpc.invoice(42, 'lbl', 'desc')['bolt11']

with pytest.raises(RpcError, match=r'WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS'):
l1.rpc.pay(inv)

# Post mortem checks that we tried only once.
status = l1.rpc.paystatus(inv)

# Should have only one attempt that triggered the wait, which then failed.
assert len(status['attempts']) == 1

0 comments on commit 9224cf2

Please sign in to comment.