From 2d129e79ab285aa42e1ed8bdd69503fbece66fd4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 12 Aug 2024 13:04:12 +0930 Subject: [PATCH] pytest: enhance test_gossip_pruning We didn't actually check that we *send* the refreshed gossip, just that we print the message saying we're going to. So check that everyone received updated gossip when this happens. Signed-off-by: Rusty Russell --- tests/test_gossip.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_gossip.py b/tests/test_gossip.py index a0f37c84f..c7753e4d2 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -39,7 +39,9 @@ def test_gossip_pruning(node_factory, bitcoind): scid2, _ = l2.fundchannel(l3, 10**6) mine_funding_to_announce(bitcoind, [l1, l2, l3]) + l1_initial_cupdate_timestamp = only_one(l1.rpc.listchannels(source=l1.info['id'])['channels'])['last_update'] + # Get timestamps of initial updates, so we can ensure they change. # Channels should be activated locally wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True] * 4) wait_for(lambda: [c['active'] for c in l2.rpc.listchannels()['channels']] == [True] * 4) @@ -57,6 +59,10 @@ def test_gossip_pruning(node_factory, bitcoind): 'Sending keepalive channel_update for {}'.format(scid2), ]) + # Everyone should see l1's update change. + for n in (l1, l2, l3): + wait_for(lambda: only_one(n.rpc.listchannels(source=l1.info['id'])['channels'])['last_update'] != l1_initial_cupdate_timestamp) + # Now kill l2, so that l1 and l3 will prune from their view after 60 seconds l2.stop()