mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: make test_mpp_adaptive more reliable
If the HTLCs are completely negotiated, we can get a channel break when we mine a pile of blocks. This is mainly seen with Postgres, due to the db speed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -3630,6 +3630,16 @@ def test_mpp_adaptive(node_factory, bitcoind):
|
|||||||
assert(c12['spendable_msat'].millisatoshis < amt)
|
assert(c12['spendable_msat'].millisatoshis < amt)
|
||||||
assert(c34['spendable_msat'].millisatoshis < amt)
|
assert(c34['spendable_msat'].millisatoshis < amt)
|
||||||
|
|
||||||
|
# Make sure all HTLCs entirely resolved before we mine more blocks!
|
||||||
|
def all_htlcs(n):
|
||||||
|
htlcs = []
|
||||||
|
for p in n.rpc.listpeers()['peers']:
|
||||||
|
for c in p['channels']:
|
||||||
|
htlcs += c['htlcs']
|
||||||
|
return htlcs
|
||||||
|
|
||||||
|
wait_for(lambda: all([all_htlcs(n) == [] for n in [l1, l2, l3, l4]]))
|
||||||
|
|
||||||
mine_funding_to_announce(bitcoind, [l1, l2, l3, l4])
|
mine_funding_to_announce(bitcoind, [l1, l2, l3, l4])
|
||||||
wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 8)
|
wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 8)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user