You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mx...@apache.org on 2017/05/04 16:11:15 UTC
incubator-ariatosca git commit: extracted global holder
Repository: incubator-ariatosca
Updated Branches:
refs/heads/ARIA-160-Operation-toolbelt-unit-tests-fail-spordically 690523304 -> 7e3ca437d
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/7e3ca437
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/7e3ca437
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/7e3ca437
Branch: refs/heads/ARIA-160-Operation-toolbelt-unit-tests-fail-spordically
Commit: 7e3ca437debde47777d044f74566302324a25262
Parents: 6905233
Author: max-orlov <ma...@gigaspaces.com>
Authored: Thu May 4 19:11:11 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Thu May 4 19:11:11 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/7e3ca437/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/7e3ca437/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/7e3ca437/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/7e3ca437/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