pytest: fix flake in test_wumbo_channels

We mine blocks too fast, and l3 discard the channel_announcment as too far in the future:

```
lightningd-3 2023-12-14T06:40:04.744Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Ignoring future channel_announcment for 103x1x1 (current block 102)
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-01-31 13:46:20 +10:30
parent 9f05250ee7
commit fa7c0a7809
3 changed files with 13 additions and 3 deletions

View file

@ -1891,7 +1891,10 @@ def test_multifunding_simple(node_factory, bitcoind):
"amount": 50000}]
l1.rpc.multifundchannel(destinations)
bitcoind.generate_block(6, wait_for_mempool=1)
bitcoind.generate_block(1, wait_for_mempool=1)
# Don't have others reject channel_announcement as too far in future.
sync_blockheight(bitcoind, [l1, l2, l3, l4])
bitcoind.generate_block(5)
for node in [l1, l2, l3, l4]:
node.daemon.wait_for_log(r'to CHANNELD_NORMAL')
@ -3471,6 +3474,8 @@ def test_wumbo_channels(node_factory, bitcoind):
# Get that mined, and announced.
bitcoind.generate_block(6, wait_for_mempool=1)
# Make sure l3 is ready to receive channel announcement!
sync_blockheight(bitcoind, [l1, l2, l3])
# Connect l3, get gossip.
l3.rpc.connect(l1.info['id'], 'localhost', port=l1.port)

View file

@ -1090,6 +1090,8 @@ def test_gossip_lease_rates(node_factory, bitcoind):
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.fundchannel(l2, 10**6)
# Don't have l2 reject channel_announcement as too far in future.
sync_blockheight(bitcoind, [l1, l2])
# Announce depth is ALWAYS 6 blocks
bitcoind.generate_block(5)

View file

@ -5,7 +5,7 @@ import pytest
import unittest
import time
from utils import (
wait_for, TEST_NETWORK, first_scid, only_one
sync_blockheight, wait_for, TEST_NETWORK, first_scid, only_one
)
@ -313,7 +313,10 @@ def test_splice_stuck_htlc(node_factory, bitcoind, executor):
assert len(list(mempool.keys())) == 1
assert result['txid'] in list(mempool.keys())
bitcoind.generate_block(6, wait_for_mempool=1)
bitcoind.generate_block(1, wait_for_mempool=1)
# Don't have l2, l3 reject channel_announcement as too far in future.
sync_blockheight(bitcoind, [l1, l2, l3])
bitcoind.generate_block(5)
l2.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL')
l1.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL')