mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
tests: test_no_fee_estimate robustify
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.
This commit is contained in:
parent
a020602b37
commit
7ba6097d3c
1 changed files with 9 additions and 0 deletions
|
@ -2299,12 +2299,20 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
|
||||||
# Can't use feerate names, either.
|
# Can't use feerate names, either.
|
||||||
with pytest.raises(RpcError, match=r'Cannot estimate fees'):
|
with pytest.raises(RpcError, match=r'Cannot estimate fees'):
|
||||||
l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'urgent')
|
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')
|
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')
|
l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'slow')
|
||||||
|
|
||||||
with pytest.raises(RpcError, match=r'Cannot estimate fees'):
|
with pytest.raises(RpcError, match=r'Cannot estimate fees'):
|
||||||
l1.rpc.fundchannel(l2.info['id'], 10**6, 'urgent')
|
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')
|
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')
|
l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow')
|
||||||
|
|
||||||
# Can with manual feerate.
|
# Can with manual feerate.
|
||||||
|
@ -2350,6 +2358,7 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
|
||||||
|
|
||||||
# Can now fund a channel (as a test, use slow feerate).
|
# Can now fund a channel (as a test, use slow feerate).
|
||||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||||
|
sync_blockheight(bitcoind, [l1])
|
||||||
l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow')
|
l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow')
|
||||||
|
|
||||||
# Can withdraw (use urgent feerate). `minconf` may be needed depending on
|
# Can withdraw (use urgent feerate). `minconf` may be needed depending on
|
||||||
|
|
Loading…
Add table
Reference in a new issue