mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-10 17:44:22 +01:00
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>
This commit is contained in:
committed by
Rusty Russell
parent
11eaabdbe6
commit
c1f4c86589
@@ -125,8 +125,16 @@ class NodeFactory(object):
|
||||
return node
|
||||
|
||||
def killall(self):
|
||||
rcs = []
|
||||
failed = False
|
||||
for n in self.nodes:
|
||||
n.stop()
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user