From f32d27bcbeb9d5381a77f60a99a4b9c4b01de7ff Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 14 Jul 2022 09:59:00 +0930 Subject: [PATCH] pytest: fix assumption in test_rbf_reconnect_tx_construct that we disconnect instantly. Signed-off-by: Rusty Russell --- tests/test_opening.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index 8d63b2a929db..2e5d426c015e 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -653,7 +653,7 @@ def test_rbf_reconnect_tx_construct(node_factory, bitcoind, chainparams): l1.rpc.connect(l2.info['id'], 'localhost', l2.port) with pytest.raises(RpcError): l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) - assert l1.rpc.getpeer(l2.info['id']) is not None + wait_for(lambda: l1.rpc.getpeer(l2.info['id'])['connected'] is False) # Now we finish off the completes failure check for d in disconnects[-2:]: @@ -661,6 +661,7 @@ def test_rbf_reconnect_tx_construct(node_factory, bitcoind, chainparams): bump = l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) with pytest.raises(RpcError): update = l1.rpc.openchannel_update(chan_id, bump['psbt']) + wait_for(lambda: l1.rpc.getpeer(l2.info['id'])['connected'] is False) # Now we succeed l1.rpc.connect(l2.info['id'], 'localhost', l2.port)