From 859070a5ed0657191af1f004f9e6d513fcbe781c Mon Sep 17 00:00:00 2001 From: cornwarecjp Date: Tue, 30 Jan 2018 10:52:35 +0100 Subject: [PATCH] Terminate LightningD if, for some reason, it doesn't start properly. This cleans up the environment for future test runs. --- tests/test_lightningd.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 5f72f41b6..6855f7536 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -129,7 +129,12 @@ class NodeFactory(object): '--log-file={}/valgrind-errors.%p'.format(node.daemon.lightning_dir) ] + node.daemon.cmd_line - node.daemon.start() + try: + node.daemon.start() + except: + node.daemon.stop() + raise + # Cache `getinfo`, we'll be using it a lot node.info = node.rpc.getinfo() return node