Add a sleep after delete before purging
heat-manage purge_deleted 0 might not purge deleted stacks which are
less than a second old, this is a cause of gate failures.
Change-Id: Ie95370354aa0534483730ef1ce93f46d004931d8
Closes-Bug: 1570398
diff --git a/functional/test_purge.py b/functional/test_purge.py
index 42feee3..fd652a9 100644
--- a/functional/test_purge.py
+++ b/functional/test_purge.py
@@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import time
+
from oslo_concurrency import processutils
from heat_integrationtests.functional import functional_base
@@ -30,6 +32,7 @@
stacks = dict((stack.id, stack) for stack in
self.client.stacks.list(show_deleted=True))
self.assertIn(stack_identifier.split('/')[1], stacks)
+ time.sleep(1)
cmd = "heat-manage purge_deleted 0"
processutils.execute(cmd, shell=True)
stacks = dict((stack.id, stack) for stack in
@@ -40,6 +43,7 @@
stack_identifier = self.stack_create(template=self.template,
tags="foo,bar")
self._stack_delete(stack_identifier)
+ time.sleep(1)
cmd = "heat-manage purge_deleted 0"
processutils.execute(cmd, shell=True)
stacks = dict((stack.id, stack) for stack in