diff --git a/tests/test_pay.py b/tests/test_pay.py index 465e0bedf..2eec94c91 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -266,7 +266,8 @@ def test_pay_disconnect(node_factory, bitcoind): route = l1.rpc.getroute(l2.info['id'], 123000, 1)["route"] l2.stop() - wait_for(lambda: only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected'] is False) + # Make sure channeld has exited! + wait_for(lambda: 'owner' not in only_one(only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['channels'])) # Can't pay while its offline. with pytest.raises(RpcError, match=r'failed: WIRE_TEMPORARY_CHANNEL_FAILURE \(First peer not ready\)'):