diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py index 68ded53f4..6ac84b354 100644 --- a/contrib/pyln-testing/pyln/testing/fixtures.py +++ b/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): diff --git a/tests/test_wallet.py b/tests/test_wallet.py index 6aec6fe47..8f1ec9054 100644 --- a/tests/test_wallet.py +++ b/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()