pytest: Give details about which node exited with a return code != 0

This commit is contained in:
Christian Decker
2019-11-29 16:11:39 +01:00
parent 518c43a9c2
commit 15f04d5fff
2 changed files with 3 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ def node_factory(request, directory, test_name, bitcoind, executor, db_provider,
def map_node_error(nodes, f, msg):
for n in nodes:
if n and f(n):
teardown_checks.add_node_error(n, msg)
teardown_checks.add_node_error(n, msg.format(n=n))
map_node_error(nf.nodes, printValgrindErrors, "reported valgrind errors")
map_node_error(nf.nodes, printCrashLog, "had crash.log files")
@@ -181,9 +181,7 @@ def node_factory(request, directory, test_name, bitcoind, executor, db_provider,
map_node_error(nf.nodes, lambda n: n.daemon.is_in_log('bad hsm request'), "had bad hsm requests")
map_node_error(nf.nodes, lambda n: n.daemon.is_in_log(r'Accessing a null column'), "Accessing a null column")
map_node_error(nf.nodes, checkMemleak, "had memleak messages")
if not ok:
teardown_checks.add_error("At least one lightning exited with unexpected non-zero return code")
map_node_error(nf.nodes, lambda n: n.rc != 0 and not n.may_fail, "Node exited with return code {n.rc}")
def getValgrindErrors(node):