From 75496ad168404380fc85c445d0847bc2f0cf91aa Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 4 May 2020 11:07:41 +0930 Subject: [PATCH] pytest: fix flaky test_peerinfo If we don't wait for close tx to reach mempool, it might not get to depth 100, and we don't get 'onchaind complete, forgetting peer'. Signed-off-by: Rusty Russell --- tests/test_connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index 69d67d827..ea233d2b5 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1596,7 +1596,8 @@ def test_peerinfo(node_factory, bitcoind): wait_for(lambda: not only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected']) wait_for(lambda: not only_one(l2.rpc.listpeers(l1.info['id'])['peers'])['connected']) - bitcoind.generate_block(100) + # Make sure close tx hits mempool before we mine blocks. + bitcoind.generate_block(100, wait_for_mempool=1) l1.daemon.wait_for_log('onchaind complete, forgetting peer') l2.daemon.wait_for_log('onchaind complete, forgetting peer')