From be8e45b16d8235c3503591457d62840b684465d6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Sep 2021 11:38:50 +0930 Subject: [PATCH] pytest: fix flake in test_gossip.py::test_addgossip We can miss it in both logs, so wait for it instead: ``` 2021-09-22T07:25:59.1582950Z > l3.rpc.addgossip(ann.split()[3]) 2021-09-22T07:25:59.1583911Z E AttributeError: 'NoneType' object has no attribute 'split' ``` Signed-off-by: Rusty Russell --- tests/test_gossip.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_gossip.py b/tests/test_gossip.py index 568634667..9645f7a22 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -1933,9 +1933,8 @@ def test_addgossip(node_factory): # 0x0100 = channel_announcement # 0x0102 = channel_update # 0x0101 = node_announcement - ann = l1.daemon.is_in_log(r"\[OUT\] 0100.*") - if ann is None: - ann = l2.daemon.is_in_log(r"\[OUT\] 0100.*") + l1.daemon.logsearch_start = 0 + ann = l1.daemon.wait_for_log(r"\[OUT\] 0100.*") upd1 = l1.daemon.is_in_log(r"\[OUT\] 0102.*") upd2 = l2.daemon.is_in_log(r"\[OUT\] 0102.*")