From 0bc80c468751b6d53952543522023e204512cc37 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 24 Oct 2018 14:34:02 +1030 Subject: [PATCH] pytest: make sure we wait for node announcements in line_graph too. Occasional failure in test_fulfill_incoming_first where the channel closed before the final message from dev_disonnect was read. Cause was the peer writing a gossip msg and failing due to ECONNRESET, before it read the final message. (Managed to reproduce under strace -f, FTW). This is really a symptom of the fact that line_graph's announce=True didn't wait for node announcements. Let's do that. Signed-off-by: Rusty Russell --- tests/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/utils.py b/tests/utils.py index e5444fd93..506f9fd94 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -833,6 +833,11 @@ class NodeFactory(object): wait_for(lambda: both_dirs_ready(nodes[0], scids[-1])) wait_for(lambda: both_dirs_ready(nodes[-1], scids[0])) + # Make sure we have all node announcements, too (just check ends) + for n in nodes: + for end in (nodes[0], nodes[-1]): + wait_for(lambda: 'alias' in only_one(end.rpc.listnodes(n.info['id'])['nodes'])) + return nodes def killall(self, expected_successes):