summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Stanek <dstanek@dstanek.com>2013-12-20 16:31:42 +0000
committerDavid Stanek <dstanek@dstanek.com>2014-01-15 10:54:19 -0500
commit2b384b868c7b6bddec600787de06d8b47fedce67 (patch)
tree4cdf5373fff4293198e135ab86da54971591f22d
parent01d26314d316d61443ee3a4c55f6d06bac477600 (diff)
downloadkeystone-2b384b868c7b6bddec600787de06d8b47fedce67.tar.gz
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
-rw-r--r--keystone/tests/test_keystoneclient.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/keystone/tests/test_keystoneclient.py b/keystone/tests/test_keystoneclient.py
index 03c9a0623..cce7c13b1 100644
--- a/keystone/tests/test_keystoneclient.py
+++ b/keystone/tests/test_keystoneclient.py
@@ -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