From 52d3ff067e7e145c73ef768fca5bfb71e89b054c Mon Sep 17 00:00:00 2001 From: Chris Yeoh Date: Mon, 29 Apr 2013 20:18:25 +0930 Subject: Fix flakey TestS3ImageService bug test_show_translates_image_state_correctly sometimes fails on some systems. This is caused because the ec2utils cache is reset after the test rather than before the test (but after the images are manually added to the db in setUp). This change resets the ec2utils cache in the correct place Fixes bug 1174266 Change-Id: I2ff9b71c932c913ca0423b1de4c04ca7d9de59cf --- nova/tests/image/test_s3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/tests/image/test_s3.py b/nova/tests/image/test_s3.py index 1775fe131..8cdde1dc6 100644 --- a/nova/tests/image/test_s3.py +++ b/nova/tests/image/test_s3.py @@ -98,7 +98,7 @@ class TestS3ImageService(test.TestCase): fake.stub_out_image_service(self.stubs) self.image_service = s3.S3ImageService() - self.addCleanup(ec2utils.reset_cache) + ec2utils.reset_cache() def tearDown(self): super(TestS3ImageService, self).tearDown() -- cgit