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
This commit is contained in:
Zane Bitter 2019-10-16 21:12:47 -04:00
parent 89ab96176f
commit 3b4e0cda28
1 changed files with 4 additions and 0 deletions

View File

@ -58,4 +58,8 @@ resources:
parameters=parameters, parameters=parameters,
expected_status='UPDATE_IN_PROGRESS') 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) self.cancel_update_stack(stack_identifier)