From 9915386c4a089ea28dc63b4cb8e29b68871ddc66 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sat, 14 Sep 2019 20:02:42 +0200 Subject: [PATCH] pytest: Stabilize test_no_fee_estimate against UTXO selection issues The test was implicitly relying on us selecting the larger output and then not touching the smaller, leaving it there for the final `withdraw` to claim. This ordering of UTXOs is not guaranteed, and in particular can fail when switching DB backends. To stabilize we just need to make sure to select the change output as well. --- tests/test_connection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index 8b497cdc0..e461c48e9 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1583,8 +1583,9 @@ def test_no_fee_estimate(node_factory, bitcoind, executor): l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow') - # Can withdraw (use urgent feerate). - l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'urgent') + # Can withdraw (use urgent feerate). `minconf` may be needed depending on + # the previous `fundchannel` selecting all confirmed outputs. + l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'urgent', minconf=0) @unittest.skipIf(not DEVELOPER, "needs --dev-disconnect")