Reduces memory utilization during test runs

It turns out that when the Python test framework runs it will create an
instance of TestCase (actually the subclass containing our tests) of
each test in the TestCase. These instances don't get cleaned up until
the very end of the test run. This means that if there are lots of tests
and/or lots of instance variables created in the setUp() you use lots of
memory.

Change-Id: Ie9451feafd47d4a4b9a0ff6d8459b45a1645d1ee
This commit is contained in:
David Stanek 2013-12-20 16:31:42 +00:00
parent 01d26314d3
commit 2b384b868c

View File

@ -66,8 +66,10 @@ class CompatTestCase(tests.NoModule, tests.TestCase):
conf = self._paste_config('keystone')
fixture = self.useFixture(appserver.AppServer(conf, appserver.MAIN))
self.public_server = fixture.server
self.addCleanup(delattr, self, 'public_server')
fixture = self.useFixture(appserver.AppServer(conf, appserver.ADMIN))
self.admin_server = fixture.server
self.addCleanup(delattr, self, 'admin_server')
if isinstance(self.checkout_info, str):
revdir = self.checkout_info