Skip to content
Snippets Groups Projects
Commit 827684ae authored by Philip ABBET's avatar Philip ABBET
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,10 @@ class Server(MessageHandler): ...@@ -74,6 +74,10 @@ class Server(MessageHandler):
)) ))
def destroy(self):
self.context.destroy()
def __str__(self): def __str__(self):
return 'Server(%s)' % self.address return 'Server(%s)' % self.address
...@@ -367,6 +371,7 @@ class Agent(object): ...@@ -367,6 +371,7 @@ class Agent(object):
self.db_process.rm() self.db_process.rm()
self.db_process = None self.db_process = None
self.server.destroy()
self.server = None self.server = None
return retval return retval
......
...@@ -152,6 +152,7 @@ class Executor(object): ...@@ -152,6 +152,7 @@ class Executor(object):
self.output_list = None self.output_list = None
self.data_sinks = [] self.data_sinks = []
self.data_sources = [] self.data_sources = []
self.context = None
# runs validation if required # runs validation if required
self.errors = [] self.errors = []
...@@ -183,6 +184,7 @@ class Executor(object): ...@@ -183,6 +184,7 @@ class Executor(object):
self.output_list = None self.output_list = None
self.data_sinks = [] self.data_sinks = []
self.data_sources = [] self.data_sources = []
self.context = None
self.db_address = None self.db_address = None
if not isinstance(data, dict): #user has passed a file pointer if not isinstance(data, dict): #user has passed a file pointer
...@@ -268,6 +270,10 @@ class Executor(object): ...@@ -268,6 +270,10 @@ class Executor(object):
self.data_sources = [] self.data_sources = []
self.agent = None self.agent = None
if self.context is not None:
self.context.destroy()
self.context = None
def _prepare_inputs(self): def _prepare_inputs(self):
"""Prepares all input required by the execution.""" """Prepares all input required by the execution."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment