From d4ed1c7f6f0bc27edb0091d803380f2447049e21 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 7 Aug 2023 13:11:49 +0930 Subject: [PATCH] pytest: test that we close connection if adding an HTLC times out. Signed-off-by: Rusty Russell --- tests/test_closing.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_closing.py b/tests/test_closing.py index aca67f264..c4de52d26 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -3641,6 +3641,7 @@ def test_close_weight_estimate(node_factory, bitcoind): assert signed_weight + 6 >= final_estimate # 70byte signature +@pytest.mark.xfail(strict=True) @pytest.mark.developer("needs dev_disconnect") def test_onchain_close_upstream(node_factory, bitcoind): """https://github.com/ElementsProject/lightning/issues/4649 @@ -3677,6 +3678,10 @@ We send an HTLC, and peer unilaterally closes: do we close upstream? with pytest.raises(RpcError, match=r'WIRE_TEMPORARY_CHANNEL_FAILURE \(reply from remote\)'): l1.rpc.waitsendpay(ph2, timeout=TIMEOUT) + # An important response to the timeout is to force a reconnect, + # since the problem may be TCP connectivity. + assert only_one(l2.rpc.listpeerchannels(l3.info['id'])['channels'])['peer_connected'] is False + # Make close unilaterally. l3.rpc.close(l2.info['id'], 1)