GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 21ed6ab0 authored by Olof Svensson's avatar Olof Svensson

Issue #3: Fix for failing actor and workflow tests

parent 60c4c780
......@@ -44,6 +44,7 @@ class StopActor(object):
self.parent = parent
def trigger(self, inData):
time.sleep(1)
logger.debug('In trigger {0}, errorHandler = {1}'.format(self.name, self.errorHandler))
# Check if parent is workflow
if self.parent is not None and not isinstance(self.parent, Submodel.Submodel):
......@@ -64,8 +65,16 @@ class StopActor(object):
logger.debug('In {0}, parent {1}, before lock.release'.format(self.name, self.parent.name))
self.lock.release()
logger.debug('In {0}, parent {1}, after lock.release'.format(self.name, self.parent.name))
elif self.errorHandler is not None:
self.errorHandler.errorHandler.stopActor.trigger(inData)
else:
if self.errorHandler is not None:
# No parent or of type submodel, the stop actor to be triggered is in the error handler
self.errorHandler.errorHandler.stopActor.trigger(inData)
else:
# No parent, just release the lock
self.outData = inData
logger.debug('In {0}, before lock.release'.format(self.name))
self.lock.release()
logger.debug('In {0}, after lock.release'.format(self.name))
def join(self, timeout=7200):
if timeout is None:
......
......@@ -101,7 +101,7 @@ class TestPythonActor(unittest.TestCase):
start = StartActor()
stop = StopActor()
router = RouterActor(
self,
parent=None,
itemName="a",
listPort=['other', 'null']
)
......
......@@ -40,8 +40,10 @@ logger = logging.getLogger('testWorkflow')
class TestWorkflows(unittest.TestCase):
def setUp(self):
os.environ['PYPUSHFLOW_MONGOURL'] = 'mongodb://pybes:pybes@linsvensson.esrf.fr:27017/pybes'
os.environ['PYPUSHFLOW_INITIATOR'] = 'TestWorkflows'
# Test mongodb server
# os.environ['PYPUSHFLOW_MONGOURL'] = 'mongodb://pybes:pybes@linsvensson.esrf.fr:27017/pybes'
# os.environ['PYPUSHFLOW_INITIATOR'] = 'TestWorkflows'
pass
def test_Workflow1(self):
testWorkflow1 = Workflow1('Test workflow 1')
......
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