From 9137ea262beddfa193393f6cfcc82ff1b401f401 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 26 Jun 2022 14:20:01 +0930 Subject: [PATCH] pytest: don't assume that join_nodes needs only check ends. I saw another "only_one()" fail on alias checking: it's not entirely clear to me with the more aggressive sending of own gossip, that we necessarily process in order, so we might not have actually seen all channels just because we saw the farthest one. Signed-off-by: Rusty Russell --- contrib/pyln-testing/pyln/testing/utils.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index 2671f4c38..57e51beac 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -1452,15 +1452,15 @@ class NodeFactory(object): bitcoind.generate_block(5) - # Make sure everyone sees all channels: we can cheat and - # simply check the ends (since it's a line). - nodes[0].wait_channel_active(scids[-1]) - nodes[-1].wait_channel_active(scids[0]) - - # Make sure we have all node announcements, too (just check ends) + # Make sure everyone sees all channels, all other nodes for n in nodes: - for end in (nodes[0], nodes[-1]): - wait_for(lambda: 'alias' in only_one(end.rpc.listnodes(n.info['id'])['nodes'])) + for scid in scids: + n.wait_channel_active(scid) + + # Make sure we have all node announcements, too + for n in nodes: + for n2 in nodes: + wait_for(lambda: 'alias' in only_one(n.rpc.listnodes(n2.info['id'])['nodes'])) def line_graph(self, num_nodes, fundchannel=True, fundamount=FUNDAMOUNT, wait_for_announce=False, opts=None, announce_channels=True): """ Create nodes, connect them and optionally fund channels.