Clear all caches before measure FieldOverride performance
This commit is contained in:
@@ -8,6 +8,7 @@ import mock
|
||||
|
||||
from courseware.views import progress # pylint: disable=import-error
|
||||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
from django.core.cache import get_cache
|
||||
from django.test.client import RequestFactory
|
||||
from django.test.utils import override_settings
|
||||
@@ -124,10 +125,9 @@ class FieldOverridePerformanceTestCase(ProceduralCourseTestMixin,
|
||||
|
||||
# Switch to published-only mode to simulate the LMS
|
||||
with self.settings(MODULESTORE_BRANCH='published-only'):
|
||||
# Clear the cache before measuring
|
||||
# We clear the mongo_metadata_inheritance cache so that we can refill it
|
||||
# with published-only contents.
|
||||
get_cache('mongo_metadata_inheritance').clear()
|
||||
# Clear all caches before measuring
|
||||
for cache in settings.CACHES:
|
||||
get_cache(cache).clear()
|
||||
|
||||
# Refill the metadata inheritance cache
|
||||
modulestore().get_course(self.course.id, depth=None)
|
||||
@@ -167,10 +167,10 @@ class TestFieldOverrideMongoPerformance(FieldOverridePerformanceTestCase):
|
||||
|
||||
TEST_DATA = {
|
||||
'no_overrides': [
|
||||
(26, 7, 19), (132, 7, 131), (592, 7, 537)
|
||||
(26, 7, 19), (134, 7, 131), (594, 7, 537)
|
||||
],
|
||||
'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):
|
||||
|
||||
TEST_DATA = {
|
||||
'no_overrides': [
|
||||
(24, 4, 9), (132, 19, 54), (592, 84, 215)
|
||||
(26, 4, 9), (134, 19, 54), (594, 84, 215)
|
||||
],
|
||||
'ccx': [
|
||||
(24, 4, 9), (132, 19, 54), (592, 84, 215)
|
||||
(26, 4, 9), (134, 19, 54), (594, 84, 215)
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user