From 61d146a2e75404255326a50e3deec66673aeb830 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 24 May 2021 11:51:20 +0930 Subject: [PATCH] pytest: fix gossip flake in test_restart_many_payments ``` 2021-05-23T09:18:56.9768962Z lightningd-4: 2021-05-23T08:33:31.918Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Ignoring future channel_announcment for 103x4x0 (current block 102) 2021-05-23T09:18:56.9771608Z lightningd-4: 2021-05-23T08:33:31.918Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 103x4x0/0 2021-05-23T09:18:56.9774035Z lightningd-4: 2021-05-23T08:33:31.919Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 103x4x0/1 ``` Signed-off-by: Rusty Russell --- tests/test_connection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index 7f60f6c89..80fea2994 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -2925,9 +2925,11 @@ def test_restart_many_payments(node_factory, bitcoind): # OK to use change from previous fundings l1.rpc.fundchannel(n.info['id'], 10**6, minconf=0) - # Now mine them, get scids. - bitcoind.generate_block(6, wait_for_mempool=num * 2) + # Now mine them, get scids; make sure they all see the first block + # otherwise they may complain about channel_announcement from the future. + bitcoind.generate_block(1, wait_for_mempool=num * 2) sync_blockheight(bitcoind, [l1] + nodes) + bitcoind.generate_block(5) wait_for(lambda: [only_one(n.rpc.listpeers()['peers'])['channels'][0]['state'] for n in nodes] == ['CHANNELD_NORMAL'] * len(nodes))