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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-02-27 14:53:51 +10:30
parent a048a54f83
commit c7718aa2e4

View file

@ -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