Browse Source

pytest: Make sure to clean up all lightningds after failures

A failed returncode check could result in the cleanup for other
lightningds to be skipped. Now make sure to cleanup all and then
rethrow an exception that contains all returncodes.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
c1f4c86589
  1. 8
      tests/test_lightningd.py

8
tests/test_lightningd.py

@ -125,8 +125,16 @@ class NodeFactory(object):
return node
def killall(self):
rcs = []
failed = False
for n in self.nodes:
try:
n.stop()
except:
failed = True
rcs.append(n.daemon.proc.returncode)
if failed:
raise Exception("At least one lightning exited with non-zero return code: {}".format(rcs))
class BaseLightningDTests(unittest.TestCase):

Loading…
Cancel
Save