From 5aa108f17679a70db60ca91c3e7a8b41d9cd72cf Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 23 Mar 2022 21:13:44 +1030 Subject: [PATCH] pytest: fix flake in test_pay.py::test_setchannel_state The second disconnect could fail, if slow enough: ``` > l1.rpc.disconnect(l2.info['id'], force=True) tests/test_pay.py:2067: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ contrib/pyln-client/pyln/client/lightning.py:690: in disconnect return self.call("disconnect", payload) contrib/pyln-testing/pyln/testing/utils.py:639: in call res = LightningRpc.call(self, method, payload) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = method = 'disconnect' payload = {'force': True, 'id': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d'} ... > raise RpcError(method, payload, resp['error']) E pyln.client.lightning.RpcError: RPC call failed: method: disconnect, payload: {'id': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d', 'force': True}, error: {'code': -1, 'message': 'Peer not connected'} ``` Signed-off-by: Rusty Russell --- tests/test_pay.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_pay.py b/tests/test_pay.py index 8942c6ccf..12a5c8b62 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -2064,7 +2064,6 @@ def test_setchannel_state(node_factory, bitcoind): # Disconnect and unilaterally close from l2 to l1 l2.rpc.disconnect(l1.info['id'], force=True) - l1.rpc.disconnect(l2.info['id'], force=True) result = l2.rpc.close(scid, 1) assert result['type'] == 'unilateral'