From a40fe40ad2df51c058a578aa98df19b1633e1d1e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 29 May 2019 06:40:30 +0930 Subject: [PATCH] pytest: catch more gossip-related errors. Basically, any "Bad" message from gossipd is something we should look at. This covers failures loading the gossip_store, too! Signed-off-by: Rusty Russell --- tests/fixtures.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 928ac65bb..8d914ee17 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -132,8 +132,8 @@ def node_factory(request, directory, test_name, bitcoind, executor): check_errors(request, err_count, "{} nodes had unexpected reconnections") for node in nf.nodes: - err_count += checkBadGossipOrder(node) - check_errors(request, err_count, "{} nodes had bad gossip order") + err_count += checkBadGossip(node) + check_errors(request, err_count, "{} nodes had bad gossip messages") for node in nf.nodes: err_count += checkBadReestablish(node) @@ -204,8 +204,17 @@ def checkReconnect(node): return 0 -def checkBadGossipOrder(node): - if node.daemon.is_in_log('Bad gossip order from (?!error)') and not node.daemon.is_in_log('Deleting channel'): +def checkBadGossip(node): + # We can get bad gossip order from inside error msgs. + if node.daemon.is_in_log('Bad gossip order from (?!error)'): + # This can happen if a node sees a node_announce after a channel + # is deleted, however. + if node.daemon.is_in_log('Deleting channel'): + return 0 + return 1 + + # Other 'Bad' messages shouldn't happen. + if node.daemon.is_in_log(r'gossipd.*Bad (?!gossip order from error)'): return 1 return 0