Commit 827684ae authored by Philip ABBET's avatar Philip ABBET

Fix: destroy the zmq contexts when not needed anymore

Otherwise, they will be destroyed when Python decides to delete the objects, which
might cause problems during the tests
parent 2b49fc0c
......@@ -74,6 +74,10 @@ class Server(MessageHandler):
))
def destroy(self):
self.context.destroy()
def __str__(self):
return 'Server(%s)' % self.address
......@@ -367,6 +371,7 @@ class Agent(object):
self.db_process.rm()
self.db_process = None
self.server.destroy()
self.server = None
return retval
......
......@@ -152,6 +152,7 @@ class Executor(object):
self.output_list = None
self.data_sinks = []
self.data_sources = []
self.context = None
# runs validation if required
self.errors = []
......@@ -183,6 +184,7 @@ class Executor(object):
self.output_list = None
self.data_sinks = []
self.data_sources = []
self.context = None
self.db_address = None
if not isinstance(data, dict): #user has passed a file pointer
......@@ -268,6 +270,10 @@ class Executor(object):
self.data_sources = []
self.agent = None
if self.context is not None:
self.context.destroy()
self.context = None
def _prepare_inputs(self):
"""Prepares all input required by the execution."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment