From f5143d954984816b64f8a77214dc7aec35641e2b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 17 Aug 2018 13:44:38 +0930 Subject: [PATCH] pytest: fail if we see 'bad reestablish' in the logs. Really, we should use log-level more cleverly here. Signed-off-by: Rusty Russell --- tests/fixtures.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/fixtures.py b/tests/fixtures.py index 10f870e38..85cfcb1d2 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -124,6 +124,11 @@ def node_factory(directory, test_name, bitcoind, executor): if err_count: raise ValueError("{} nodes had bad gossip order".format(err_count)) + for node in nf.nodes: + err_count += checkBadReestablish(node) + if err_count: + raise ValueError("{} nodes had bad reestablish".format(err_count)) + if not ok: raise Exception("At least one lightning exited with unexpected non-zero return code") @@ -184,6 +189,12 @@ def checkBadGossipOrder(node): return 0 +def checkBadReestablish(node): + if node.daemon.is_in_log('Bad reestablish'): + return 1 + return 0 + + @pytest.fixture def executor(): ex = futures.ThreadPoolExecutor(max_workers=20)