mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
pytest: make join_nodes / line_graph wait for updates in both dirs.
This is what fund_channel() does, which is more thorough than what we were doing. But since the order of the logs is undefined, we need to be a little careful. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
8f455c8b98
commit
02b413a4dc
1 changed files with 21 additions and 1 deletions
|
@ -1105,9 +1105,29 @@ class NodeFactory(object):
|
||||||
for src, dst in connections:
|
for src, dst in connections:
|
||||||
wait_for(lambda: src.channel_state(dst) == 'CHANNELD_NORMAL')
|
wait_for(lambda: src.channel_state(dst) == 'CHANNELD_NORMAL')
|
||||||
scid = src.get_channel_scid(dst)
|
scid = src.get_channel_scid(dst)
|
||||||
src.daemon.wait_for_log(r'Received channel_update for channel {scid}/. now ACTIVE'.format(scid=scid))
|
|
||||||
scids.append(scid)
|
scids.append(scid)
|
||||||
|
|
||||||
|
# We don't want to assume message order here.
|
||||||
|
# Wait for ends:
|
||||||
|
nodes[0].daemon.wait_for_logs([r'update for channel {}/0 now ACTIVE'
|
||||||
|
.format(scids[0]),
|
||||||
|
r'update for channel {}/1 now ACTIVE'
|
||||||
|
.format(scids[0])])
|
||||||
|
nodes[-1].daemon.wait_for_logs([r'update for channel {}/0 now ACTIVE'
|
||||||
|
.format(scids[-1]),
|
||||||
|
r'update for channel {}/1 now ACTIVE'
|
||||||
|
.format(scids[-1])])
|
||||||
|
# Now wait for intermediate nodes:
|
||||||
|
for i, n in enumerate(nodes[1:-1]):
|
||||||
|
n.daemon.wait_for_logs([r'update for channel {}/0 now ACTIVE'
|
||||||
|
.format(scids[i]),
|
||||||
|
r'update for channel {}/1 now ACTIVE'
|
||||||
|
.format(scids[i]),
|
||||||
|
r'update for channel {}/0 now ACTIVE'
|
||||||
|
.format(scids[i + 1]),
|
||||||
|
r'update for channel {}/1 now ACTIVE'
|
||||||
|
.format(scids[i + 1])])
|
||||||
|
|
||||||
if not wait_for_announce:
|
if not wait_for_announce:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue