mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-12 18:49:42 +01:00
pytest: fix flake in test_custommsg_triggers_notification
If listpeers on l2 is called too fast, then it won't return any peers, and we will fail: ``` # Connect l1 to l2 l1.connect(l2) > wait_for(lambda: l2.rpc.listpeers(l1.info['id'])['peers'][0]['connected']) tests/test_misc.py:2690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ contrib/pyln-testing/pyln/testing/utils.py:88: in wait_for while not success(): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > wait_for(lambda: l2.rpc.listpeers(l1.info['id'])['peers'][0]['connected']) E IndexError: list index out of range ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
6778f320d2
commit
bf9cdc597e
1 changed files with 1 additions and 1 deletions
|
@ -2687,7 +2687,7 @@ def test_custommsg_triggers_notification(node_factory):
|
|||
|
||||
# Connect l1 to l2
|
||||
l1.connect(l2)
|
||||
wait_for(lambda: l2.rpc.listpeers(l1.info['id'])['peers'][0]['connected'])
|
||||
wait_for(lambda: [p['connected'] for p in l2.rpc.listpeers(l1.info['id'])['peers']] == [True])
|
||||
|
||||
# Send a custommsg from l2 to l1
|
||||
# The message id 7777 is chosen to be sufficiently high and shouldn't be used by the
|
||||
|
|
Loading…
Add table
Reference in a new issue