From e366cb17f63787b8c7e90858969b555280afe9fe Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 11 Jan 2022 11:47:12 +1030 Subject: [PATCH] pytest: fix flake in test_reconnect_sender_add1 l1 might split in a commitment_signed before it notices the disconnect, and this test fails: ``` for i in range(0, len(disconnects)): with pytest.raises(RpcError): l1.rpc.sendpay(route, rhash, payment_secret=inv['payment_secret']) > l1.rpc.waitsendpay(rhash) E Failed: DID NOT RAISE ``` Signed-off-by: Rusty Russell --- tests/test_connection.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_connection.py b/tests/test_connection.py index b50dee021..afde7d9f9 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -643,12 +643,14 @@ def test_reconnect_normal(node_factory): @pytest.mark.openchannel('v2') def test_reconnect_sender_add1(node_factory): # Fail after add is OK, will cause payment failure though. + # Make sure it doesn't send commit before it sees disconnect though. disconnects = ['-WIRE_UPDATE_ADD_HTLC', '+WIRE_UPDATE_ADD_HTLC'] # Feerates identical so we don't get gratuitous commit to update them l1 = node_factory.get_node(disconnect=disconnects, may_reconnect=True, + options={'commit-time': 2000}, feerates=(7500, 7500, 7500, 7500)) l2 = node_factory.get_node(may_reconnect=True) l1.rpc.connect(l2.info['id'], 'localhost', l2.port)