Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-160-Operation-toolbelt-unit-tests-fail-spordically 7e3ca437d 
-> 788cfd9df (forced update)


extracted global holder


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/788cfd9d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/788cfd9d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/788cfd9d

Branch: refs/heads/ARIA-160-Operation-toolbelt-unit-tests-fail-spordically
Commit: 788cfd9dfbaad62fd0ba76cc76f09e900a06bc1a
Parents: 6905233
Author: max-orlov <[email protected]>
Authored: Thu May 4 19:11:11 2017 +0300
Committer: max-orlov <[email protected]>
Committed: Sat May 6 18:43:02 2017 +0300

----------------------------------------------------------------------
 aria/orchestrator/workflows/core/task.py     |  1 -
 tests/helpers.py                             |  8 ++++++++
 tests/orchestrator/context/test_operation.py | 11 ++++++-----
 tests/orchestrator/context/test_toolbelt.py  | 10 ++++++----
 4 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/788cfd9d/aria/orchestrator/workflows/core/task.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/core/task.py 
b/aria/orchestrator/workflows/core/task.py
index 4abe865..78159c4 100644
--- a/aria/orchestrator/workflows/core/task.py
+++ b/aria/orchestrator/workflows/core/task.py
@@ -162,7 +162,6 @@ class OperationTask(BaseTask):
                                 workdir=self._workflow_context._workdir)
         self._task_id = task_model.id
         self._update_fields = None
-        self._model_task = None
 
     def execute(self):
         super(OperationTask, self).execute()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/788cfd9d/tests/helpers.py
----------------------------------------------------------------------
diff --git a/tests/helpers.py b/tests/helpers.py
index 472d696..6c9712b 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 import os
+from threading import local
 
 from . import ROOT_DIR
 from .resources import DIR as RESOURCES_DIR
@@ -29,3 +30,10 @@ def get_resource_uri(*args):
 
 def get_service_template_uri(*args):
     return os.path.join(RESOURCES_DIR, 'service-templates', *args)
+
+
+def create_global_test_holder():
+    thread_local = local()
+    thread_local.holder = {}
+    return thread_local.holder
+

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/788cfd9d/tests/orchestrator/context/test_operation.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/context/test_operation.py 
b/tests/orchestrator/context/test_operation.py
index b78ecff..5112179 100644
--- a/tests/orchestrator/context/test_operation.py
+++ b/tests/orchestrator/context/test_operation.py
@@ -15,7 +15,6 @@
 
 import os
 import time
-from threading import local
 
 import pytest
 
@@ -29,15 +28,17 @@ from aria.orchestrator import context
 from aria.orchestrator.workflows import api
 
 import tests
-from tests import mock, storage
+from tests import (
+    mock,
+    storage,
+    helpers
+)
 from . import (
     op_path,
     execute,
 )
 
-_thread_local = local()
-_thread_local.holder = {}
-global_test_holder = _thread_local.holder
+global_test_holder = helpers.create_global_test_holder()
 
 @pytest.fixture
 def ctx(tmpdir):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/788cfd9d/tests/orchestrator/context/test_toolbelt.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/context/test_toolbelt.py 
b/tests/orchestrator/context/test_toolbelt.py
index 5b05f04..3675c16 100644
--- a/tests/orchestrator/context/test_toolbelt.py
+++ b/tests/orchestrator/context/test_toolbelt.py
@@ -23,15 +23,17 @@ from aria.orchestrator.workflows import api
 from aria.orchestrator.workflows.executor import thread
 from aria.orchestrator.context.toolbelt import RelationshipToolBelt
 
-from tests import mock, storage
+from tests import (
+    mock,
+    storage,
+    helpers
+)
 from . import (
     op_path,
     execute,
 )
 
-_thread_local = local()
-_thread_local.holder = {}
-global_test_holder = _thread_local.holder
+global_test_holder = helpers.create_global_test_holder()
 
 
 @pytest.fixture

Reply via email to