mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
test_lightning: don't fire prematurely on test_gossip_jsonrpc.
We wait the the receipt of the CHANNEL_UPDATE message by channeld, but that doesn't mean it reached gossipd yet, causing spurious test failure. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
a4dd523c8b
commit
896ecb4da7
@ -1375,20 +1375,22 @@ class LightningDTests(BaseLightningDTests):
|
||||
l1.daemon.wait_for_logs(['peer_out WIRE_ANNOUNCEMENT_SIGNATURES',
|
||||
'peer_in WIRE_ANNOUNCEMENT_SIGNATURES'])
|
||||
|
||||
# Could happen in either order.
|
||||
channel_id = channels[0]['short_channel_id']
|
||||
# Could happen in any order.
|
||||
l1.daemon.wait_for_logs(['peer_out WIRE_CHANNEL_ANNOUNCEMENT',
|
||||
'peer_in WIRE_CHANNEL_ANNOUNCEMENT'])
|
||||
'peer_in WIRE_CHANNEL_ANNOUNCEMENT',
|
||||
'Channel {}\\(0\\) was updated.'
|
||||
.format(channel_id),
|
||||
'Channel {}\\(1\\) was updated.'
|
||||
.format(channel_id)])
|
||||
|
||||
nodes = l1.rpc.getnodes()['nodes']
|
||||
assert set([n['nodeid'] for n in nodes]) == set([l1.info['id'], l2.info['id']])
|
||||
|
||||
l1.daemon.wait_for_log('peer_in WIRE_CHANNEL_UPDATE')
|
||||
l2.daemon.wait_for_log('peer_in WIRE_CHANNEL_UPDATE')
|
||||
|
||||
wait_for(lambda: [c['active'] for c in l1.rpc.getchannels()['channels']] == [True, True])
|
||||
wait_for(lambda: [c['public'] for c in l1.rpc.getchannels()['channels']] == [True, True])
|
||||
wait_for(lambda: [c['active'] for c in l2.rpc.getchannels()['channels']] == [True, True])
|
||||
wait_for(lambda: [c['public'] for c in l2.rpc.getchannels()['channels']] == [True, True])
|
||||
assert [c['active'] for c in l1.rpc.getchannels()['channels']] == [True, True]
|
||||
assert [c['public'] for c in l1.rpc.getchannels()['channels']] == [True, True]
|
||||
assert [c['active'] for c in l2.rpc.getchannels()['channels']] == [True, True]
|
||||
assert [c['public'] for c in l2.rpc.getchannels()['channels']] == [True, True]
|
||||
|
||||
def ping_tests(self, l1, l2):
|
||||
# 0-byte pong gives just type + length field.
|
||||
|
Loading…
Reference in New Issue
Block a user