Skip to content

Commit

Permalink
pytest: fix flake in test_wumbo_channels
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rustyrussell committed Dec 15, 2023
1 parent 1f1d7e6 commit 4a51e68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -3470,6 +3473,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)

Expand Down
2 changes: 2 additions & 0 deletions tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 4 additions & 1 deletion tests/test_splicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 4a51e68

Please sign in to comment.