From 03449e3cf0656d674d9bf89ec7b5ff449077668c Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 14 Jan 2021 11:46:38 +0100 Subject: [PATCH] pytest: Stabilize test_gossip_persistence We weren't waiting for the `dev_fail` transaction to hit the mempool, throwing the results off. --- tests/test_gossip.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_gossip.py b/tests/test_gossip.py index b4c71dd17..9a392bc35 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -426,8 +426,9 @@ def test_gossip_persistence(node_factory, bitcoind): # Now spend the funding tx, generate a block and see others deleting the # channel from their network view l1.rpc.dev_fail(l2.info['id']) - time.sleep(1) - bitcoind.generate_block(1) + + # We need to wait for the unilateral close to hit the mempool + bitcoind.generate_block(1, wait_for_mempool=1) wait_for(lambda: active(l1) == [scid23, scid23]) wait_for(lambda: active(l2) == [scid23, scid23])