]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix an intermitting failure in test_metadata_refresh
authorThomas Herve <therve@gmail.com>
Fri, 31 May 2013 21:19:56 +0000 (14:19 -0700)
committerThomas Herve <therve+rackspace@gmail.com>
Fri, 31 May 2013 21:22:40 +0000 (14:22 -0700)
Given that resource creation can happen in parallel, the call to
check_create_complete may not follow the call to handle_create, so mock
those without checking the order.

Change-Id: Icf40f7339dc4c6e885c4a42f3a2c3f546f14c08d

heat/tests/test_metadata_refresh.py

index c985df8128af9b8bc897e3154155077f7e958018..dcaf5c3a407aba294636cb29bf3529e3cf081548 100644 (file)
@@ -145,7 +145,8 @@ class MetadataRefreshTest(HeatTestCase):
         self.m.StubOutWithMock(instance.Instance, 'check_create_complete')
         for cookie in (object(), object()):
             instance.Instance.handle_create().AndReturn(cookie)
-            instance.Instance.check_create_complete(cookie).AndReturn(True)
+            create_complete = instance.Instance.check_create_complete(cookie)
+            create_complete.InAnyOrder().AndReturn(True)
         self.m.StubOutWithMock(instance.Instance, 'FnGetAtt')
 
         return stack