pytest: fail if we see 'bad reestablish' in the logs.

Really, we should use log-level more cleverly here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-08-17 13:44:38 +09:30 committed by Christian Decker
parent 83eadb3548
commit f5143d9549

View File

@ -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)