Wait for the policy to be done in tests
As observed in the amqp job, we sometimes signal scale policy too fast, without waiting for the medata to be set. It creates a timeout. We can check the metadata of the policy before signaling again, to make sure that we can move forward. Change-Id: I9857803ef960efbd034f05985ec8fcc7272e2f70
This commit is contained in:
@@ -655,10 +655,14 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
||||
return matched
|
||||
time.sleep(build_interval)
|
||||
|
||||
def check_autoscale_complete(self, stack_id, expected_num):
|
||||
def check_autoscale_complete(self, stack_id, expected_num, parent_stack,
|
||||
policy):
|
||||
res_list = self.client.resources.list(stack_id)
|
||||
all_res_complete = all(res.resource_status in ('UPDATE_COMPLETE',
|
||||
'CREATE_COMPLETE')
|
||||
for res in res_list)
|
||||
all_res = len(res_list) == expected_num
|
||||
return all_res and all_res_complete
|
||||
if all_res and all_res_complete:
|
||||
metadata = self.client.resources.metadata(parent_stack, policy)
|
||||
return not metadata.get('scaling_in_progress')
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user