Browse Source

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

travis-debug
Christian Decker 5 years ago
parent
commit
15f04d5fff
  1. 6
      contrib/pyln-testing/pyln/testing/fixtures.py
  2. 2
      tests/test_wallet.py

6
contrib/pyln-testing/pyln/testing/fixtures.py

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

2
tests/test_wallet.py

@ -568,7 +568,7 @@ def test_transaction_annotations(node_factory, bitcoind):
@unittest.skipIf(VALGRIND, "It does not play well with prompt and key derivation.")
def test_hsm_secret_encryption(node_factory):
l1 = node_factory.get_node()
l1 = node_factory.get_node(may_fail=True) # May fail when started without key
password = "reckful\n"
# We need to simulate a terminal to use termios in `lightningd`.
master_fd, slave_fd = os.openpty()

Loading…
Cancel
Save