From 7ed2126ee75ffe9ecba3e5fb04df17c216f790f5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 17 Nov 2024 10:31:48 +1030 Subject: [PATCH] pytest: fix flake in test_fetchinvoice_disconnected_reply. Fails when l3 doesn't know address for l1, to connect to it: ``` 2024-11-16T04:45:42.2243366Z lightningd-3 2024-11-16T04:35:10.582Z DEBUG 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-connectd: peer_in WIRE_ONION_MESSAGE 2024-11-16T04:45:42.2244342Z lightningd-3 2024-11-16T04:35:10.582Z DEBUG lightningd: Got onionmsg reply_path 2024-11-16T04:45:42.2245398Z lightningd-3 2024-11-16T04:35:10.582Z DEBUG plugin-offers: Note: disallowing deprecated onion_message_recv.blinding 2024-11-16T04:45:42.2246408Z lightningd-3 2024-11-16T04:35:10.586Z UNUSUAL plugin-offers: No incoming channel for 5msat, so no blinded path 2024-11-16T04:45:42.2247289Z lightningd-3 2024-11-16T04:35:10.605Z DEBUG hsmd: Client: Received message 25 from client 2024-11-16T04:45:42.2248372Z lightningd-3 2024-11-16T04:35:10.606Z DEBUG plugin-offers: connecting directly to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 2024-11-16T04:45:42.2249451Z lightningd-3 2024-11-16T04:35:10.606Z DEBUG gossipd: REPLY WIRE_GOSSIPD_GET_ADDRS_REPLY with 0 fds 2024-11-16T04:45:42.2250743Z lightningd-3 2024-11-16T04:35:10.607Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-connectd: Failed connected out: Unable to connect, no address known for peer ``` This is because the test which was supposed to wait for addresses is wrong: it passes when l3 knows nothing! (`all([])` == `True`) Signed-off-by: Rusty Russell --- tests/test_pay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pay.py b/tests/test_pay.py index 0cd880efdadb..556c93c18a4d 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -4746,7 +4746,7 @@ def test_fetchinvoice_disconnected_reply(node_factory, bitcoind): # Make l1, l2 public (so l3 can auto connect). node_factory.join_nodes([l1, l2], wait_for_announce=True) # Make sure l3 knows about l1's public address - wait_for(lambda: all(['addresses' in n for n in l3.rpc.listnodes()['nodes']])) + wait_for(lambda: ['addresses' in n for n in l3.rpc.listnodes()['nodes']] == [True] * 2) offer = l3.rpc.offer(amount='5msat', description='test_fetchinvoice_disconnected_reply')