From 0240882ddaa0cbef3166a31d6ca4e17d95e9334c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 23 Feb 2026 10:56:29 +1030 Subject: [PATCH] pytest: fix flake in test_gossip_store_compact_while_extending and test_gossmap_lost_node node_factory.line_graph waits until all nodes have seen all channels, not all node announcements, so we can get this: ``` > assert post_nodes == pre_nodes ... E Full diff: E [ E { E + 'addresses': [], E + 'alias': 'JUNIORYARD-b2d9563', E + 'color': '02287b', E + 'features': '808898880a8a59a1', E + 'last_timestamp': 1771565748, E 'nodeid': '02287bfac8b99b35477ebe9334eede1e32b189e24644eb701c079614712331cec0', E }, E { E 'addresses': [], E 'alias': 'SILENTGOPHER-b2d9563', E 'color': '033845', E 'features': '808898880a8a59a1', ... tests/test_gossip.py:1710: AssertionError ``` Since the same pattern occurs in test_gossmap_lost_node, fix that too. Signed-off-by: Rusty Russell --- tests/test_gossip.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_gossip.py b/tests/test_gossip.py index e0b1ed9b06..30f94174de 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -1691,6 +1691,8 @@ def test_gossip_store_compact_while_extending(node_factory, bitcoind, executor): wait_for(lambda: sorted([c['fee_per_millionth'] for c in l1.rpc.listchannels(scid12)['channels']]) == [10, 1004]) pre_channels = l1.rpc.listchannels() + # Make sure all node_announcements have been seen. + wait_for(lambda: all(['alias' in n for n in l1.rpc.listnodes()['nodes']])) pre_nodes = sorted(l1.rpc.listnodes()['nodes'], key=lambda n: n['nodeid']) # Compaction "continues". @@ -2493,6 +2495,8 @@ def test_gossmap_lost_node(node_factory, bitcoind): assert l1.rpc.listchannels(scid23) == {'channels': []} pre_channels = l1.rpc.listchannels() + # Make sure all node_announcements have been seen. + wait_for(lambda: all(['alias' in n for n in l1.rpc.listnodes()['nodes']])) pre_nodes = sorted(l1.rpc.listnodes()['nodes'], key=lambda n: n['nodeid']) l1.restart() post_channels = l1.rpc.listchannels()