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)