Skip to content

Commit

Permalink
pytest: Fix the flaky test_plugin_connected_hook test
Browse files Browse the repository at this point in the history
It was a bit eager :-)

Signed-off-by: Christian Decker <@cdecker>
  • Loading branch information
cdecker authored and niftynei committed Apr 30, 2019
1 parent eeecfc9 commit c96cc8a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import OrderedDict
from fixtures import * # noqa: F401,F403
from lightning import RpcError, Millisatoshi
from utils import only_one
from utils import only_one, wait_for

import os
import pytest
Expand Down Expand Up @@ -169,8 +169,11 @@ def test_plugin_connected_hook(node_factory):
.format(l1.info['id']))
l3.daemon.wait_for_log(r"You are in reject list")

peer = l1.rpc.listpeers(l3.info['id'])['peers']
assert(peer == [] or not peer[0]['connected'])
def check_disconnect():
peers = l1.rpc.listpeers(l3.info['id'])['peers']
return peers == [] or not peers[0]['connected']

wait_for(check_disconnect)


def test_async_rpcmethod(node_factory, executor):
Expand Down

0 comments on commit c96cc8a

Please sign in to comment.