From 07c275e436f200688f7cdd91a4cdb37314cbc1a4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 6 Feb 2018 12:01:55 +1030 Subject: [PATCH] test_lightningd: fix race in test_closing_different_fees fundrawtransaction returns before the actual sendrawtx, so we can end up mining blocks before it's sent, thus not having enough confirms. We handle this correctly in fund_channel, but this test open-codes it for speed with multiple peers. Signed-off-by: Rusty Russell --- tests/test_lightningd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index aa3f771b5..fe2f790d8 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -1015,7 +1015,7 @@ class LightningDTests(BaseLightningDTests): num_peers = len(feerates) * len(amounts) self.give_funds(l1, (10**6) * num_peers + 10000 * num_peers) - # Create them in a batch, but only valgrind one in three, for speed! + # Create them in a batch, for speed! peers = [] for feerate in feerates: for amount in amounts: @@ -1029,7 +1029,9 @@ class LightningDTests(BaseLightningDTests): peers.append(p) for p in peers: - l1.rpc.fundchannel(p.info['id'], 10**6) + l1.rpc.fundchannel(p.info['id'], 10**6) + # Technically, this is async to fundchannel returning. + l1.daemon.wait_for_log('sendrawtx exit 0') bitcoind.generate_block(6)