From b5ae4c12c720f7fd9ba5811f5170c9543b2cd483 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Aug 2018 21:15:33 +0930 Subject: [PATCH] pytest: fix flaky wait_for_log() in test_funder_feerate_reconnect. The comment was wrong: the channel being locked in was triggering the fee update and hence the disconnect. But that can actually happen before fund_channel returns, as that waits for the gossipd to see the channel active. Best to do the fee update manually, so it's exactly what we want. Signed-off-by: Rusty Russell --- tests/test_connection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index 1107d7c0f..fa69fedb2 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1160,13 +1160,14 @@ def test_no_fee_estimate(node_factory, bitcoind, executor): def test_funder_feerate_reconnect(node_factory, bitcoind): # l1 updates fees, then reconnect so l2 retransmits commitment_signed. disconnects = ['-WIRE_COMMITMENT_SIGNED'] - l1 = node_factory.get_node(may_reconnect=True) + l1 = node_factory.get_node(may_reconnect=True, + feerates=(7500, 7500, 7500)) l2 = node_factory.get_node(disconnect=disconnects, may_reconnect=True) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l1.fund_channel(l2, 10**6) - # lockin will cause fee update, causing disconnect. - bitcoind.generate_block(5) + # create fee update, causing disconnect. + l1.set_feerates((15000, 7500, 3750)) l2.daemon.wait_for_log('dev_disconnect: \-WIRE_COMMITMENT_SIGNED') # Wait until they reconnect.