Skip to content

Commit c0a40b3

Browse files
rustyrussellcdecker
authored andcommitted
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 <[email protected]>
1 parent e684f87 commit c0a40b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_pay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_pay_disconnect(node_factory, bitcoind):
249249
route = l1.rpc.getroute(l2.info['id'], 123000, 1)["route"]
250250

251251
l2.stop()
252-
wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [False, False])
252+
wait_for(lambda: only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected'] is False)
253253

254254
# Can't pay while its offline.
255255
with pytest.raises(RpcError, match=r'failed: WIRE_TEMPORARY_CHANNEL_FAILURE \(First peer not ready\)'):

0 commit comments

Comments
 (0)