mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: fix flake in test_pay_disconnect
Channel can be inactive before it disconnects, apparently. Check
explicitly for the disconnected state so we get the expected error.
Here's what happened:
```
# Can't pay while its offline.
with pytest.raises(RpcError, match=r'failed: WIRE_TEMPORARY_CHANNEL_FAILURE \(First peer not ready\)'):
> l1.rpc.sendpay(route, rhash)
E Failed: DID NOT RAISE <class 'pyln.client.lightning.RpcError'>
```
And the logs show that the outgoing HTLC was sent to channeld before it
realized the connection was closed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
e684f87ef7
commit
c0a40b37a7
@@ -249,7 +249,7 @@ def test_pay_disconnect(node_factory, bitcoind):
|
|||||||
route = l1.rpc.getroute(l2.info['id'], 123000, 1)["route"]
|
route = l1.rpc.getroute(l2.info['id'], 123000, 1)["route"]
|
||||||
|
|
||||||
l2.stop()
|
l2.stop()
|
||||||
wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [False, False])
|
wait_for(lambda: only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected'] is False)
|
||||||
|
|
||||||
# Can't pay while its offline.
|
# Can't pay while its offline.
|
||||||
with pytest.raises(RpcError, match=r'failed: WIRE_TEMPORARY_CHANNEL_FAILURE \(First peer not ready\)'):
|
with pytest.raises(RpcError, match=r'failed: WIRE_TEMPORARY_CHANNEL_FAILURE \(First peer not ready\)'):
|
||||||
|
|||||||
Reference in New Issue
Block a user