Skip to content

Commit

Permalink
tests: test_no_fee_estimate robustify
Browse files Browse the repository at this point in the history
Nested `with` exception checks don't work; fix flakes i'm seeing with
valgrind causing failures because blockchain not up to date when
`fundchannel` called.
  • Loading branch information
niftynei committed Feb 24, 2021
1 parent a020602 commit 7ba6097
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2299,12 +2299,20 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
# Can't use feerate names, either.
with pytest.raises(RpcError, match=r'Cannot estimate fees'):
l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'urgent')

with pytest.raises(RpcError, match=r'Cannot estimate fees'):
l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'normal')

with pytest.raises(RpcError, match=r'Cannot estimate fees'):
l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'slow')

with pytest.raises(RpcError, match=r'Cannot estimate fees'):
l1.rpc.fundchannel(l2.info['id'], 10**6, 'urgent')

with pytest.raises(RpcError, match=r'Cannot estimate fees'):
l1.rpc.fundchannel(l2.info['id'], 10**6, 'normal')

with pytest.raises(RpcError, match=r'Cannot estimate fees'):
l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow')

# Can with manual feerate.
Expand Down Expand Up @@ -2350,6 +2358,7 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):

# Can now fund a channel (as a test, use slow feerate).
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
sync_blockheight(bitcoind, [l1])
l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow')

# Can withdraw (use urgent feerate). `minconf` may be needed depending on
Expand Down

0 comments on commit 7ba6097

Please sign in to comment.