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.
This commit is contained in:
Christian Decker 2019-09-14 20:02:42 +02:00 committed by Rusty Russell
parent 063b319da1
commit 9915386c4a

View File

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