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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-08-12 13:04:12 +09:30
parent 975dd76086
commit 2d129e79ab

View file

@ -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()