From 312209ad60a722b91145785e6f92802a942e769b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 4 Sep 2018 12:24:32 +0930 Subject: [PATCH] pytest: support simple subdaemon debugging. Signed-off-by: Rusty Russell --- doc/HACKING.md | 6 ++++-- tests/utils.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/HACKING.md b/doc/HACKING.md index d0e2c1eea..bdfb8488f 100644 --- a/doc/HACKING.md +++ b/doc/HACKING.md @@ -174,7 +174,7 @@ A modern desktop can build and run through all the tests in a couple of minutes make -j12 check PYTEST_PAR=24 DEVELOPER=1 VALGRIND=0 -Adust `-j` and `PYTEST_PAR` accordingly for your hardware. +Adjust `-j` and `PYTEST_PAR` accordingly for your hardware. There are three kinds of tests: @@ -200,7 +200,9 @@ There are three kinds of tests: `PYTHONPATH=contrib/pylightning py.test -v tests/`. - You can also append `-k TESTNAME` to run a single test. + You can also append `-k TESTNAME` to run a single test. Environment variables + `DEBUG_SUBD=` and `TIMEOUT=` can be useful for debugging + subdaemons on individual tests. Our Travis CI instance (see `.travis.yml`) runs all these for each pull request. diff --git a/tests/utils.py b/tests/utils.py index 6b1faa101..cc2fe9373 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -703,6 +703,8 @@ class NodeFactory(object): if DEVELOPER: daemon.opts["dev-fail-on-subdaemon-fail"] = None daemon.env["LIGHTNINGD_DEV_MEMLEAK"] = "1" + if os.getenv("DEBUG_SUBD"): + daemon.opts["dev-debugger"] = os.getenv("DEBUG_SUBD") if VALGRIND: daemon.env["LIGHTNINGD_DEV_NO_BACKTRACE"] = "1" if not may_reconnect: