Skip to content

Commit 312209a

Browse files
rustyrussellcdecker
authored andcommitted
pytest: support simple subdaemon debugging.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 7b9341e commit 312209a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/HACKING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ A modern desktop can build and run through all the tests in a couple of minutes
174174

175175
make -j12 check PYTEST_PAR=24 DEVELOPER=1 VALGRIND=0
176176

177-
Adust `-j` and `PYTEST_PAR` accordingly for your hardware.
177+
Adjust `-j` and `PYTEST_PAR` accordingly for your hardware.
178178

179179
There are three kinds of tests:
180180

@@ -200,7 +200,9 @@ There are three kinds of tests:
200200

201201
`PYTHONPATH=contrib/pylightning py.test -v tests/`.
202202

203-
You can also append `-k TESTNAME` to run a single test.
203+
You can also append `-k TESTNAME` to run a single test. Environment variables
204+
`DEBUG_SUBD=<subdaemon>` and `TIMEOUT=<seconds>` can be useful for debugging
205+
subdaemons on individual tests.
204206

205207
Our Travis CI instance (see `.travis.yml`) runs all these for each
206208
pull request.

tests/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ def get_node(self, disconnect=None, options=None, may_fail=False, may_reconnect=
703703
if DEVELOPER:
704704
daemon.opts["dev-fail-on-subdaemon-fail"] = None
705705
daemon.env["LIGHTNINGD_DEV_MEMLEAK"] = "1"
706+
if os.getenv("DEBUG_SUBD"):
707+
daemon.opts["dev-debugger"] = os.getenv("DEBUG_SUBD")
706708
if VALGRIND:
707709
daemon.env["LIGHTNINGD_DEV_NO_BACKTRACE"] = "1"
708710
if not may_reconnect:

0 commit comments

Comments
 (0)