summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Gibizer <balazs.gibizer@est.tech>2021-09-20 20:53:02 +0200
committerBalazs Gibizer <balazs.gibizer@est.tech>2021-11-19 18:21:06 +0100
commita5e713b62235fd91e7edc89cc951b30dcb2e7c86 (patch)
tree11de5a388633b4b16b42dd73ff36486fca5e5b77
parent6211913213cdfb78e35a0e4096d51a7ef71c13f8 (diff)
downloadheat-a5e713b62235fd91e7edc89cc951b30dcb2e7c86.tar.gz
Reproduce bug story/2009237
Add a functional test that reproduces the bug that nested resource group timeout value is increasing rapidly with every nesting level. Story: 2009237 Task: 43373 Change-Id: I8e85434a5fb9cc6d0ef3240c8ae6085f5124174b (cherry picked from commit 863d645d7ef223a2534423e623fbc1c420c8557f) (cherry picked from commit 74280022e8dbe306c59a49f73b78ab40688fe6a6)
-rw-r--r--heat_integrationtests/functional/test_resource_group.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/heat_integrationtests/functional/test_resource_group.py b/heat_integrationtests/functional/test_resource_group.py
index ebce70df7..999d41122 100644
--- a/heat_integrationtests/functional/test_resource_group.py
+++ b/heat_integrationtests/functional/test_resource_group.py
@@ -129,6 +129,68 @@ resources:
outputs.append(validate_output(stack, 'random2', 30))
self.assertEqual(outputs, self._stack_output(stack, 'all_values'))
+ def test_create_nested_groups_with_timeout(self):
+ parent_template = '''
+heat_template_version: rocky
+resources:
+ parent_group:
+ type: OS::Heat::ResourceGroup
+ update_policy:
+ batch_create: { max_batch_size: 1, pause_time: 1 }
+ properties:
+ count: 2
+ resource_def:
+ type: child.yaml
+'''
+ child_template = '''
+heat_template_version: rocky
+resources:
+ child_group:
+ type: OS::Heat::ResourceGroup
+ update_policy:
+ batch_create: { max_batch_size: 1, pause_time: 1 }
+ properties:
+ count: 2
+ resource_def:
+ type: value.yaml
+'''
+ value_template = '''
+heat_template_version: rocky
+resources:
+ value:
+ type: OS::Heat::Value
+ properties:
+ type: string
+ value: 'test'
+'''
+ files = {
+ 'child.yaml': child_template,
+ 'value.yaml': value_template,
+ }
+ stack_identifier = self.stack_create(
+ template=parent_template,
+ files=files,
+ timeout=10, # in minutes
+ )
+
+ resources = self.client.resources.list(
+ stack_identifier, nested_depth=2, with_detail=True)
+ timeouts = set()
+ for res in resources:
+ if res.resource_type == "OS::Heat::ResourceGroup":
+ nested_stack = self.client.stacks.get(res.physical_resource_id)
+ timeouts.add(nested_stack.timeout_mins)
+
+ # FIXME(gibi): This is bug story/2009237 as the timeout calculation of
+ # nested resource groups are broken. It is using seconds for the
+ # calculation but then pass that to functions expecting timeouts in
+ # minutes leading to increasing timeout value with each nesting level.
+ self.assertEqual({35939, 599}, timeouts)
+ # After the bug is fixed we expect timeouts less than the overall
+ # timeout requested for the whole stack.
+
+ # self.assertEqual({10}, timeouts)
+
def test_update_increase_decrease_count(self):
# create stack with resource group count 2
env = {'resource_registry':