From 04403ed59f09d69ce4208c8dd2b04a34c195af32 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 31 Oct 2019 14:39:11 +1030 Subject: [PATCH] pytest: fix flaky 'Bad gossip' error in test_block_backfill Sometimes the l3 seeker asks for scids, and the reply contains the channel which is then closed by the time it checks, so it considers the updates bad gossip. Signed-off-by: Rusty Russell --- tests/test_db.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_db.py b/tests/test_db.py index e45af3f08..2462a1da1 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -79,6 +79,10 @@ def test_block_backfill(node_factory, bitcoind, chainparams): # Make sure we also have the needle we added to the haystack above assert(31337 in [r['satoshis'] for r in l3.db_query("SELECT satoshis FROM utxoset")]) + # Make sure that l3 doesn't ask for more gossip and get a reply about + # the closed channel (hence Bad gossip msgs in log). + l3.daemon.wait_for_log('seeker: state = NORMAL') + # Now close the channel and make sure `l3` cleans up correctly: txid = l1.rpc.close(l2.info['id'])['txid'] bitcoind.generate_block(1, wait_for_mempool=txid)