From c7718aa2e4067743f4e2beb881054e979c4384b8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 27 Feb 2018 14:53:51 +1030 Subject: [PATCH] test_lightningd.py: repair flaky test_bitcoin_failure If bitcoind is still fetching blocks, we might accidentally inject the failure between getblockhash and getblock. That's OK, but it's not the failure we test for. Signed-off-by: Rusty Russell --- tests/test_lightningd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 11c5af947..d09f2af6e 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -1118,6 +1118,9 @@ class LightningDTests(BaseLightningDTests): def test_bitcoin_failure(self): l1 = self.node_factory.get_node(fake_bitcoin_cli=True) + # Make sure we're not failing it between getblockhash and getblock. + sync_blockheight([l1]) + self.fake_bitcoind_fail(l1, 1) # This should cause both estimatefee and getblockhash fail