Commit b06d256f by Calen Pennington

Clear all caches before measure FieldOverride performance

parent e4bc328c
...@@ -8,6 +8,7 @@ import mock ...@@ -8,6 +8,7 @@ import mock
from courseware.views import progress # pylint: disable=import-error from courseware.views import progress # pylint: disable=import-error
from datetime import datetime from datetime import datetime
from django.conf import settings
from django.core.cache import get_cache from django.core.cache import get_cache
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.test.utils import override_settings from django.test.utils import override_settings
...@@ -124,10 +125,9 @@ class FieldOverridePerformanceTestCase(ProceduralCourseTestMixin, ...@@ -124,10 +125,9 @@ class FieldOverridePerformanceTestCase(ProceduralCourseTestMixin,
# Switch to published-only mode to simulate the LMS # Switch to published-only mode to simulate the LMS
with self.settings(MODULESTORE_BRANCH='published-only'): with self.settings(MODULESTORE_BRANCH='published-only'):
# Clear the cache before measuring # Clear all caches before measuring
# We clear the mongo_metadata_inheritance cache so that we can refill it for cache in settings.CACHES:
# with published-only contents. get_cache(cache).clear()
get_cache('mongo_metadata_inheritance').clear()
# Refill the metadata inheritance cache # Refill the metadata inheritance cache
modulestore().get_course(self.course.id, depth=None) modulestore().get_course(self.course.id, depth=None)
...@@ -167,10 +167,10 @@ class TestFieldOverrideMongoPerformance(FieldOverridePerformanceTestCase): ...@@ -167,10 +167,10 @@ class TestFieldOverrideMongoPerformance(FieldOverridePerformanceTestCase):
TEST_DATA = { TEST_DATA = {
'no_overrides': [ 'no_overrides': [
(26, 7, 19), (132, 7, 131), (592, 7, 537) (26, 7, 19), (134, 7, 131), (594, 7, 537)
], ],
'ccx': [ 'ccx': [
(24, 7, 47), (132, 7, 455), (592, 7, 2037) (26, 7, 47), (134, 7, 455), (594, 7, 2037)
], ],
} }
...@@ -184,9 +184,9 @@ class TestFieldOverrideSplitPerformance(FieldOverridePerformanceTestCase): ...@@ -184,9 +184,9 @@ class TestFieldOverrideSplitPerformance(FieldOverridePerformanceTestCase):
TEST_DATA = { TEST_DATA = {
'no_overrides': [ 'no_overrides': [
(24, 4, 9), (132, 19, 54), (592, 84, 215) (26, 4, 9), (134, 19, 54), (594, 84, 215)
], ],
'ccx': [ 'ccx': [
(24, 4, 9), (132, 19, 54), (592, 84, 215) (26, 4, 9), (134, 19, 54), (594, 84, 215)
] ]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment