mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-13 11:09:14 +01:00
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:
parent
9f05250ee7
commit
fa7c0a7809
3 changed files with 13 additions and 3 deletions
|
@ -1891,7 +1891,10 @@ def test_multifunding_simple(node_factory, bitcoind):
|
||||||
"amount": 50000}]
|
"amount": 50000}]
|
||||||
|
|
||||||
l1.rpc.multifundchannel(destinations)
|
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]:
|
for node in [l1, l2, l3, l4]:
|
||||||
node.daemon.wait_for_log(r'to CHANNELD_NORMAL')
|
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.
|
# Get that mined, and announced.
|
||||||
bitcoind.generate_block(6, wait_for_mempool=1)
|
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.
|
# Connect l3, get gossip.
|
||||||
l3.rpc.connect(l1.info['id'], 'localhost', port=l1.port)
|
l3.rpc.connect(l1.info['id'], 'localhost', port=l1.port)
|
||||||
|
|
||||||
|
|
|
@ -1090,6 +1090,8 @@ def test_gossip_lease_rates(node_factory, bitcoind):
|
||||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||||
l1.fundchannel(l2, 10**6)
|
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
|
# Announce depth is ALWAYS 6 blocks
|
||||||
bitcoind.generate_block(5)
|
bitcoind.generate_block(5)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import pytest
|
||||||
import unittest
|
import unittest
|
||||||
import time
|
import time
|
||||||
from utils import (
|
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 len(list(mempool.keys())) == 1
|
||||||
assert result['txid'] in list(mempool.keys())
|
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')
|
l2.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL')
|
||||||
l1.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL')
|
l1.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL')
|
||||||
|
|
Loading…
Add table
Reference in a new issue