From 25ba5b654aacdd384766dd18e0d616923705b1d2 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 16 Oct 2019 21:12:47 -0400 Subject: [PATCH] Eliminate race in CancelUpdateTest The purpose of this test is to ensure we can rollback an in-progress Server resource with attached ports. However, by cancelling immediately we create a race whereby the stack may be rolled back before we have even started updating the stack, in which case we are not testing the behaviour we actually care about. Inserting a delay gives Heat enough time to process the Port and start updating the Server before we cancel the update. In some circumstances this could also trigger a race within Heat, whereby the rollback traversal would not block, but the update traversal would retrigger it anyway. This resulted in the stack rollback being marked COMPLETE multiple times, which could also lead to errors in deleting the old raw_template after it had already been removed. The latter have been fixed by separate patches. The race itself should be addressed separately. Change-Id: I3f9db686c31659437ff4797555e6608986946572 Task: 37199 (cherry picked from commit 3b4e0cda282e3df64daf16d64081faa47dd72135) --- heat_integrationtests/functional/test_cancel_update.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/heat_integrationtests/functional/test_cancel_update.py b/heat_integrationtests/functional/test_cancel_update.py index bfeeda6437..68ba3f447e 100644 --- a/heat_integrationtests/functional/test_cancel_update.py +++ b/heat_integrationtests/functional/test_cancel_update.py @@ -58,4 +58,8 @@ resources: parameters=parameters, expected_status='UPDATE_IN_PROGRESS') + # Ensure we start updating the server before rolling back + self._wait_for_resource_status( + stack_identifier, 'Server', 'CREATE_IN_PROGRESS') + self.cancel_update_stack(stack_identifier)