summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZane Bitter <zbitter@redhat.com>2017-06-13 19:38:39 -0400
committerZane Bitter <zbitter@redhat.com>2017-06-14 16:31:54 -0400
commit41b8e44d1e89440dca994bb927ecb35784d94e34 (patch)
treefa95a05d2455a08b59699c056ee3556280d8fcf6
parent724d60949eb2abbcabfa4b33781333f0844591e5 (diff)
Fix races in SoftwareDeploymentGroupTest
Don't assume that we can get the physical IDs of all of the SoftwareDeployment resources as soon as the stack becomes CREATE_IN_PROGRESS. 4dd67bb1aa2df4f5270f79600ac1f888b0bd9a5f reads them again once the stack is COMPLETE; this patch also uses the same physical resource IDs to verify the update. Also, make sure all of the resources are IN_PROGRESS before trying to signal them, because the signal_resources() utility method only signals resources that are IN_PROGRESS. Change-Id: I9787a5de5e4272a3ab370f653182aa9283ae01c0 Closes-Bug: #1697794 Closes-Bug: #1626073 Closes-Bug: #1625921
Notes
Notes (review): Code-Review+2: huangtianhua <huangtianhua@huawei.com> Code-Review+2: Rabi Mishra <ramishra@redhat.com> Workflow+1: Rabi Mishra <ramishra@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sat, 17 Jun 2017 06:35:44 +0000 Reviewed-on: https://review.openstack.org/474004 Project: openstack/heat Branch: refs/heads/master
-rw-r--r--heat_integrationtests/functional/test_software_deployment_group.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/heat_integrationtests/functional/test_software_deployment_group.py b/heat_integrationtests/functional/test_software_deployment_group.py
index 06f0ce1..22143dc 100644
--- a/heat_integrationtests/functional/test_software_deployment_group.py
+++ b/heat_integrationtests/functional/test_software_deployment_group.py
@@ -84,8 +84,14 @@ resources:
84 expected_status='CREATE_IN_PROGRESS') 84 expected_status='CREATE_IN_PROGRESS')
85 self._wait_for_resource_status( 85 self._wait_for_resource_status(
86 stack_identifier, 'deployment', 'CREATE_IN_PROGRESS') 86 stack_identifier, 'deployment', 'CREATE_IN_PROGRESS')
87
88 # Wait for all deployment resources to become IN_PROGRESS, since only
89 # IN_PROGRESS resources get signalled
87 nested_identifier = self.assert_resource_is_a_stack( 90 nested_identifier = self.assert_resource_is_a_stack(
88 stack_identifier, 'deployment') 91 stack_identifier, 'deployment')
92 self._wait_for_stack_status(nested_identifier, 'CREATE_IN_PROGRESS')
93 self._wait_for_all_resource_status(nested_identifier,
94 'CREATE_IN_PROGRESS')
89 group_resources = self.list_group_resources( 95 group_resources = self.list_group_resources(
90 stack_identifier, 'deployment', minimal=False) 96 stack_identifier, 'deployment', minimal=False)
91 97
@@ -96,9 +102,8 @@ resources:
96 102
97 created_group_resources = self.list_group_resources( 103 created_group_resources = self.list_group_resources(
98 stack_identifier, 'deployment', minimal=False) 104 stack_identifier, 'deployment', minimal=False)
99 105 self.assertEqual(4, len(created_group_resources))
100 self.check_input_values(created_group_resources, 106 self.check_input_values(created_group_resources, 'foo', 'foo_input')
101 'foo', 'foo_input')
102 107
103 self.update_stack(stack_identifier, 108 self.update_stack(stack_identifier,
104 template=template, 109 template=template,
@@ -106,12 +111,11 @@ resources:
106 expected_status='UPDATE_IN_PROGRESS') 111 expected_status='UPDATE_IN_PROGRESS')
107 nested_identifier = self.assert_resource_is_a_stack( 112 nested_identifier = self.assert_resource_is_a_stack(
108 stack_identifier, 'deployment') 113 stack_identifier, 'deployment')
109 self.assertEqual(4, len(group_resources))
110 self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE', 114 self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE',
111 signal_required=True, 115 signal_required=True,
112 resources_to_signal=group_resources) 116 resources_to_signal=group_resources)
113 117
114 self.check_input_values(group_resources, 'foo', 'input2') 118 self.check_input_values(created_group_resources, 'foo', 'input2')
115 119
116 # We explicitly test delete here, vs just via cleanup and check 120 # We explicitly test delete here, vs just via cleanup and check
117 # the nested stack is gone 121 # the nested stack is gone