summaryrefslogtreecommitdiff
path: root/heat/tests/engine
diff options
context:
space:
mode:
authorThomas Herve <therve@redhat.com>2016-11-21 10:43:56 +0100
committerRico Lin <rico.lin@easystack.cn>2017-03-14 08:23:11 +0000
commit73f299fb495a5535017a867a10d55bb76fcc5d32 (patch)
treeccfd3c45c80bf9d9418ea8f9ec535f6f74415cc2 /heat/tests/engine
parent4608336a6e2c92e72d89c5ee6eb9f36b64ae7ad9 (diff)
downloadheat-73f299fb495a5535017a867a10d55bb76fcc5d32.tar.gz
Sleep between check_resource calls
Instead of calling check_resource on all leaves in the resource graph at once, sleep a little bit between each call. As it's a tad slower, delegate it to a thread so that the stack_create RPC message doesn't timeout when you have lots of resources. Change-Id: I84d2b34d65b3ce7d8d858de106dac531aff509b7 Partial-Bug: #1566845 (cherry picked from commit 4a500125b350b46dee0d3c9f01c3cac7223d9c80)
Diffstat (limited to 'heat/tests/engine')
-rw-r--r--heat/tests/engine/test_check_resource.py1
-rw-r--r--heat/tests/engine/tools.py6
2 files changed, 7 insertions, 0 deletions
diff --git a/heat/tests/engine/test_check_resource.py b/heat/tests/engine/test_check_resource.py
index 5d8054df5..0e8a533b3 100644
--- a/heat/tests/engine/test_check_resource.py
+++ b/heat/tests/engine/test_check_resource.py
@@ -547,6 +547,7 @@ class CheckWorkflowCleanupTest(common.HeatTestCase):
template=tools.string_template_five, convergence=True)
tstack.converge_stack(tstack.t, action=tstack.CREATE)
self.stack = stack.Stack.load(self.ctx, stack_id=tstack.id)
+ self.stack.thread_group_mgr = tools.DummyThreadGroupManager()
self.stack.converge_stack(self.stack.t, action=self.stack.DELETE)
self.resource = self.stack['A']
self.is_update = False
diff --git a/heat/tests/engine/tools.py b/heat/tests/engine/tools.py
index d62df271d..08c12e733 100644
--- a/heat/tests/engine/tools.py
+++ b/heat/tests/engine/tools.py
@@ -164,6 +164,7 @@ def get_stack(stack_name, ctx, template=None, with_params=True,
tmpl = templatem.Template(t)
stack = parser.Stack(ctx, stack_name, tmpl, convergence=convergence,
**kwargs)
+ stack.thread_group_mgr = DummyThreadGroupManager()
return stack
@@ -323,6 +324,11 @@ class DummyThreadGroupManager(object):
self.msg_queues = []
self.messages = []
+ def start(self, stack, func, *args, **kwargs):
+ # Just run the function, so we know it's completed in the test
+ func(*args, **kwargs)
+ return DummyThread()
+
def start_with_lock(self, cnxt, stack, engine_id, func, *args, **kwargs):
# Just run the function, so we know it's completed in the test
func(*args, **kwargs)