mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
pytest: Do not check for valgrind errors if disabled
Checking for valgrind errors if we disabled valgrind will kill the teardown, so don't!
This commit is contained in:
parent
6154020f67
commit
80486a6669
@ -128,8 +128,6 @@ class BaseLightningDTests(unittest.TestCase):
|
||||
self.node_factory = NodeFactory(self, self.executor)
|
||||
|
||||
def getValgrindErrors(self, node):
|
||||
if not VALGRIND:
|
||||
return None, None
|
||||
error_file = '{}valgrind-errors'.format(node.daemon.lightning_dir)
|
||||
with open(error_file, 'r') as f:
|
||||
errors = f.read().strip()
|
||||
@ -147,12 +145,15 @@ class BaseLightningDTests(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
self.node_factory.killall()
|
||||
self.executor.shutdown(wait=False)
|
||||
err_count = 0
|
||||
for node in self.node_factory.nodes:
|
||||
err_count += self.printValgrindErrors(node)
|
||||
if err_count:
|
||||
raise ValueError(
|
||||
"{} nodes reported valgrind errors".format(err_count))
|
||||
|
||||
# Do not check for valgrind error files if it is disabled
|
||||
if VALGRIND:
|
||||
err_count = 0
|
||||
for node in self.node_factory.nodes:
|
||||
err_count += self.printValgrindErrors(node)
|
||||
if err_count:
|
||||
raise ValueError(
|
||||
"{} nodes reported valgrind errors".format(err_count))
|
||||
|
||||
class LightningDTests(BaseLightningDTests):
|
||||
def connect(self):
|
||||
|
Loading…
Reference in New Issue
Block a user