Skip to content

Commit

Permalink
pytest: extend the test_fulfill_incoming_first case to cover reconnect.
Browse files Browse the repository at this point in the history
Which we don't handle, due to a separate bug, so it's xfail.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Oct 9, 2018
1 parent 15822b8 commit 4f42de2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_connection.py
Expand Up @@ -1333,6 +1333,7 @@ def test_restart_multi_htlc_rexmit(node_factory, bitcoind, executor):
wait_for(lambda: [p['status'] for p in l1.rpc.listpayments()['payments']] == ['complete', 'complete'])


@pytest.mark.xfail(strict=True)
@unittest.skipIf(not DEVELOPER, "needs dev-disconnect")
def test_fulfill_incoming_first(node_factory, bitcoind):
"""Test that we handle the case where we completely resolve incoming htlc
Expand Down Expand Up @@ -1364,3 +1365,13 @@ def test_fulfill_incoming_first(node_factory, bitcoind):
# Now, l2 should restore from DB fine, even though outgoing HTLC no longer
# has an incoming.
l2.restart()

# Manually reconnect l2->l3.
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)

# Fulfill should be retransmitted OK (ignored result).
l2.rpc.close(l3.info['id'])
l2.wait_for_channel_onchain(l3.info['id'])
bitcoind.generate_block(100)
l2.daemon.wait_for_log('onchaind complete, forgetting peer')
l3.daemon.wait_for_log('onchaind complete, forgetting peer')

0 comments on commit 4f42de2

Please sign in to comment.