Browse Source

test_lightningd: race fix for activation of channels in test_gossip_jsonrpc

```
>       assert [c['active'] for c in l2.rpc.listchannels()['channels']] == [True, True]
E       AssertionError: assert [True, False] == [True, True]
E         At index 1 diff: False != True
E         Full diff:
E         - [True, False]
E         + [True, True]
```

We don't actually wait that l2's gossipd has also processed the message.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
6ca0c6e0ec
  1. 1
      tests/test_lightningd.py

1
tests/test_lightningd.py

@ -1681,6 +1681,7 @@ class LightningDTests(BaseLightningDTests):
l2.daemon.wait_for_log(needle) l2.daemon.wait_for_log(needle)
# Need to increase timeout, intervals cannot be shortened with DEVELOPER=0 # Need to increase timeout, intervals cannot be shortened with DEVELOPER=0
wait_for(lambda: len(l1.getactivechannels()) == 2, timeout=60) wait_for(lambda: len(l1.getactivechannels()) == 2, timeout=60)
wait_for(lambda: len(l2.getactivechannels()) == 2, timeout=60)
nodes = l1.rpc.listnodes()['nodes'] nodes = l1.rpc.listnodes()['nodes']
assert set([n['nodeid'] for n in nodes]) == set([l1.info['id'], l2.info['id']]) assert set([n['nodeid'] for n in nodes]) == set([l1.info['id'], l2.info['id']])

Loading…
Cancel
Save