Speed up functional testing
test/functional/tests.py:TestObjectVersioningUTF8 does not clean up the versions files it creates because the class's multiple inheritance is such that it does not call the tearDown method in TestObjectVersioning. As a result, any attempt to clean up account containers wastes time retrying container delete requests. This occurs either in the setUp for TestSloEnv, if the TestSlo class is included in a test run, or in the tests.py package tearDown method. On the author's dev machine this patch reduces the execution time of functional tests in tests.py by approx 30% or 1 minute. Change-Id: I8194672bf2ca82435df5868720b6a55a79b94413
This commit is contained in:
parent
76c38670c2
commit
87fc21c7cf
@ -3359,16 +3359,19 @@ class TestObjectVersioning(Base):
|
||||
"Expected versioning_enabled to be True/False, got %r" %
|
||||
(self.env.versioning_enabled,))
|
||||
|
||||
def tearDown(self):
|
||||
super(TestObjectVersioning, self).tearDown()
|
||||
def _tear_down_files(self):
|
||||
try:
|
||||
# only delete files and not container
|
||||
# only delete files and not containers
|
||||
# as they were configured in self.env
|
||||
self.env.versions_container.delete_files()
|
||||
self.env.container.delete_files()
|
||||
except ResponseError:
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
super(TestObjectVersioning, self).tearDown()
|
||||
self._tear_down_files()
|
||||
|
||||
def test_clear_version_option(self):
|
||||
# sanity
|
||||
self.assertEqual(self.env.container.info()['versions'],
|
||||
@ -3602,6 +3605,10 @@ class TestObjectVersioning(Base):
|
||||
class TestObjectVersioningUTF8(Base2, TestObjectVersioning):
|
||||
set_up = False
|
||||
|
||||
def tearDown(self):
|
||||
self._tear_down_files()
|
||||
super(TestObjectVersioningUTF8, self).tearDown()
|
||||
|
||||
|
||||
class TestCrossPolicyObjectVersioning(TestObjectVersioning):
|
||||
env = TestCrossPolicyObjectVersioningEnv
|
||||
|
Loading…
Reference in New Issue
Block a user