From 8c9fa457babd8ac09009fb93fe7a1a6409aba911 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 28 Jul 2022 11:00:57 +0930 Subject: [PATCH] pytest: fix flake in test_gossip_timestamp_filter ``` # 0x0100 = channel_announcement # 0x0102 = channel_update # (Node announcement may have any timestamp) types = Counter([m[0:4] for m in msgs]) assert types['0100'] == 1 > assert types['0102'] == 2 E assert 1 == 2 tests/test_gossip.py:324: AssertionError ``` Examining the logs shows that we ask l4 for timestamps "first_timestamp=1658892115 timestamp_range=13", and the timestamp on the missing update is exactly `1658892128`. So round the end time up by 1 for filtering. Signed-off-by: Rusty Russell --- tests/test_gossip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_gossip.py b/tests/test_gossip.py index 4ce2f7967..fcd154b2a 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -285,7 +285,7 @@ def test_gossip_timestamp_filter(node_factory, bitcoind, chainparams): bitcoind.generate_block(5) l1.wait_for_channel_updates([chan23]) - after_23 = int(time.time()) + after_23 = int(time.time()) + 1 # Make sure l4 has received all the gossip. wait_for(lambda: ['alias' in node for node in l4.rpc.listnodes()['nodes']] == [True, True, True])