]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
tests: Wait for delete completion
authorZane Bitter <zbitter@redhat.com>
Thu, 13 Sep 2012 19:40:49 +0000 (21:40 +0200)
committerZane Bitter <zbitter@redhat.com>
Thu, 13 Sep 2012 19:48:05 +0000 (21:48 +0200)
Wait for the stack to actually be deleted before ending the test.

Fixes #233

Change-Id: I4f2060ff73615bcb16ac9cba3d7062117cca08dd
Signed-off-by: Zane Bitter <zbitter@redhat.com>
heat/tests/functional/util.py

index e44bba10424c2a785501b130513dcb790c083f9e..b039d193bd6b7fcfaf1e2c1583aee4fe1d6e04c9 100644 (file)
@@ -388,6 +388,14 @@ class Stack(object):
         c = self.get_heat_client()
         c.delete_stack(**parameters)
 
+        print 'Waiting for stack deletion to be completed'
+        while self.in_state('DELETE_IN_PROGRESS'):
+            tries += 1
+            assert tries < 50
+            time.sleep(10)
+
+        assert self.in_state('DELETE_COMPLETE')
+
     def get_nova_client(self):
         if self.novaclient != None:
             return self.novaclient