diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-03-19 17:56:30 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-03-19 20:43:04 -0700 |
| commit | 76844433f69a7c29ed4566ad34d7e9740feaf660 (patch) | |
| tree | bc2ea93b85aaeea895d775a77eceffc6b086c001 /nova/tests | |
| parent | 18b235867e4c348fb18ff3a6242edc9923b640c1 (diff) | |
Add caching for ec2 mapping ids.
Requests to map ec2 ids can be slow when there are a large number
of instances. These shouldn't ever change so cache them in memory
for a week. The one week timeout is simply to prevent memory from
growing uncontrollably.
Fixes bug 1157437
Change-Id: I3f1c68959a933a7aaa50f122c34a716264c8722d
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/api/ec2/test_cinder_cloud.py | 1 | ||||
| -rw-r--r-- | nova/tests/api/ec2/test_cloud.py | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/nova/tests/api/ec2/test_cinder_cloud.py b/nova/tests/api/ec2/test_cinder_cloud.py index 7b66da749..93614ef82 100644 --- a/nova/tests/api/ec2/test_cinder_cloud.py +++ b/nova/tests/api/ec2/test_cinder_cloud.py @@ -88,6 +88,7 @@ def get_instances_with_cached_ips(orig_func, *args, **kwargs): class CinderCloudTestCase(test.TestCase): def setUp(self): super(CinderCloudTestCase, self).setUp() + ec2utils.reset_cache() vol_tmpdir = self.useFixture(fixtures.TempDir()).path self.flags(compute_driver='nova.virt.fake.FakeDriver', volume_api_class='nova.tests.fake_volume.API') diff --git a/nova/tests/api/ec2/test_cloud.py b/nova/tests/api/ec2/test_cloud.py index ebf0188b9..322bbb465 100644 --- a/nova/tests/api/ec2/test_cloud.py +++ b/nova/tests/api/ec2/test_cloud.py @@ -106,6 +106,7 @@ def get_instances_with_cached_ips(orig_func, *args, **kwargs): class CloudTestCase(test.TestCase): def setUp(self): super(CloudTestCase, self).setUp() + ec2utils.reset_cache() self.flags(compute_driver='nova.virt.fake.FakeDriver', volume_api_class='nova.tests.fake_volume.API') self.useFixture(fixtures.FakeLogger('boto')) |
