From 3c87e1f3384a8edef15adbe8c4a7d43510b0a37e Mon Sep 17 00:00:00 2001 From: niftynei Date: Mon, 22 Mar 2021 15:46:08 -0500 Subject: [PATCH] test_v2_open_sigs_restart: dont mine blocks until funding tx in mempool This was flaky because sometimes we'd generate blocks before the funding transaction reached the mempool. If we wait until it's in, it works as expected. [ Neatened to use wait_for_mempool arg --RR ] --- tests/test_opening.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index 610fb46d5..311a953bb 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -137,7 +137,8 @@ def test_v2_open_sigs_restart(node_factory, bitcoind): l1.rpc.openchannel_signed(chan_id, psbt) l2.daemon.wait_for_log('Broadcasting funding tx') - bitcoind.generate_block(6) + txid = l2.rpc.listpeers(l1.info['id'])['peers'][0]['channels'][0]['funding_txid'] + bitcoind.generate_block(6, wait_for_mempool=txid) # Make sure we're ok. l2.daemon.wait_for_log(r'to CHANNELD_NORMAL')