Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: block_structure.storage_backing_for_cache toggle removed depr32 #33151

Closed
wants to merge 101 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
9eb5dc0
feat: block_structure.storage_backing_for_cache toggle removed depr32
Sep 1, 2023
de35a9d
Merge branch 'master' into edx-depr32
Yagnesh1998 Sep 4, 2023
4b7d3be
feat: update test_generate_course_blocks.py
Sep 4, 2023
1ebe285
feat: Update test_generate_course_blocks.py
Yagnesh1998 Sep 4, 2023
9c61ea1
feat: Update test_generate_course_blocks.py
Yagnesh1998 Sep 4, 2023
6cc8f19
feat: update test_generate_course_blocks.py
Sep 4, 2023
efb5927
feat: Update test_generate_course_blocks.py
Yagnesh1998 Sep 4, 2023
9046f3e
Merge branch 'master' into edx-depr32
Yagnesh1998 Sep 5, 2023
7c948ab
Merge branch 'master' into edx-depr32
Yagnesh1998 Sep 13, 2023
960d3a9
feat: update cms common.py
Sep 13, 2023
733073d
feat: update lms common.py
Sep 13, 2023
9ab9e22
feat: update test_generate_course_blocks.py
Sep 15, 2023
1655bb2
Merge branch 'master' into edx-depr32
Yagnesh1998 Sep 15, 2023
fc3baa9
feat: update test_generate_course_blocks.py
Sep 15, 2023
4bd707d
feat: Update test_generate_course_blocks.py
Yagnesh1998 Sep 18, 2023
8795526
Merge branch 'master' into edx-depr32
Yagnesh1998 Sep 18, 2023
5be3db4
feat: update test_generate_course_blocks.py
Sep 18, 2023
db1a330
feat: update test_generate_course_blocks.py
Sep 18, 2023
bd759b5
feat: update test_milestones.py
Sep 18, 2023
9c46379
feat: update test_library_content.py
Sep 18, 2023
9c8b13c
feat: Update test_milestones.py
Yagnesh1998 Sep 18, 2023
e7beb2a
Merge branch 'master' into edx-depr32
Yagnesh1998 Sep 18, 2023
0f8bb9a
feat: Update test_tasks.py
ajamal-python Sep 18, 2023
6575e55
feat: Update test_api.py
ajamal-python Oct 3, 2023
519895a
feat: Update test_course_grade_factory.py
ajamal-python Oct 3, 2023
3681b2d
feat: Update api.py
ajamal-python Oct 3, 2023
3035bbb
feat: Update manager.py
ajamal-python Oct 3, 2023
ef95001
feat: Update test_factory.py
ajamal-python Oct 3, 2023
c69c039
feat: Update test_manager.py
ajamal-python Oct 3, 2023
c4dc661
feat: Update test_store.py
ajamal-python Oct 3, 2023
4167290
feat: Update test_generate_course_blocks.py
ajamal-python Oct 3, 2023
7f40bb0
feat: Update manager.py
ajamal-python Oct 3, 2023
1aa8fab
feat: Update test_factory.py
ajamal-python Oct 3, 2023
7e591f3
feat: Update test_signals.py
ajamal-python Oct 3, 2023
faade39
Merge branch 'master' into edx-depr32
Yagnesh1998 Oct 3, 2023
619366a
feat: Update api.py
Yagnesh1998 Oct 3, 2023
22f76aa
feat: Update test_generate_course_blocks.py
Yagnesh1998 Oct 3, 2023
5784a3c
feat: Update test_factory.py
Yagnesh1998 Oct 3, 2023
699c0e6
feat: Update test_api.py
Yagnesh1998 Oct 3, 2023
591b729
feat: Update test_milestones.py
Yagnesh1998 Oct 3, 2023
36b9804
feat: Update test_api.py
Yagnesh1998 Oct 4, 2023
182f895
feat: Update test_generate_course_blocks.py
ajamal-python Oct 4, 2023
2458017
feat: Update test_api.py
ajamal-python Oct 4, 2023
92cec31
Merge branch 'master' into edx-depr32
Yagnesh1998 Oct 4, 2023
8818a23
feat: update test_generate_course_blocks.py
Oct 4, 2023
1885d11
feat: update manager.py
Oct 4, 2023
9cecca1
feat: Update manager.py
Yagnesh1998 Oct 4, 2023
626e8ef
feat: Update test_generate_course_blocks.py
Yagnesh1998 Oct 4, 2023
da215bc
feat: update test_generate_course_blocks.py
Oct 4, 2023
4f79dab
feat: Update test_api.py
ajamal-python Oct 6, 2023
ccb0282
feat: Update test_milestones.py
ajamal-python Oct 6, 2023
4e01b91
feat: Update test_course_grade_factory.py
ajamal-python Oct 6, 2023
6548314
feat: Update test_tasks.py
ajamal-python Oct 6, 2023
b32bf1e
feat: Update api.py
ajamal-python Oct 6, 2023
7674b1c
feat: Update generate_course_blocks.py
ajamal-python Oct 6, 2023
0979359
feat: Update test_generate_course_blocks.py
ajamal-python Oct 6, 2023
2a966df
feat: Update manager.py
ajamal-python Oct 6, 2023
607d055
feat: Update models.py
ajamal-python Oct 6, 2023
dc83b99
feat: Update store.py
ajamal-python Oct 6, 2023
96ee291
feat: Update test_factory.py
ajamal-python Oct 6, 2023
162ea2c
feat: Update test_manager.py
ajamal-python Oct 6, 2023
9107022
feat: Update test_signals.py
ajamal-python Oct 6, 2023
1044a70
Merge branch 'master' into edx-depr32
Yagnesh1998 Oct 6, 2023
f1ca8fc
feat: Update test_generate_course_blocks.py
ajamal-python Oct 9, 2023
90e5890
Merge branch 'master' into edx-depr32
Yagnesh1998 Oct 9, 2023
5261321
feat: update changes
Oct 9, 2023
27884af
feat: update changes
Oct 9, 2023
bad43b9
feat: Update test_api.py
ajamal-python Oct 19, 2023
a931d1e
feat: Update test_tasks.py
ajamal-python Oct 19, 2023
e82a9a9
Merge branch 'master' into edx-depr32
Yagnesh1998 Oct 19, 2023
dbd3c5f
feat: Update test_api.py
ajamal-python Oct 19, 2023
5cd4595
Merge branch 'master' into edx-depr32
Yagnesh1998 Oct 19, 2023
c116b7b
feat: update test_api.py
ajamal-python Nov 17, 2023
5dd36e0
feat: update test_milestones.py
ajamal-python Nov 17, 2023
c3773df
feat: update test_course_grade_factory.py
ajamal-python Nov 17, 2023
28c0695
feat: update test_tasks.py
ajamal-python Nov 17, 2023
1b909f6
feat: update test_transformer.py
ajamal-python Nov 17, 2023
013af32
feat: update __init__.py
ajamal-python Nov 17, 2023
0808c43
feat: update generate_course_blocks.py
ajamal-python Nov 17, 2023
aa7e1cc
feat: update test_generate_course_blocks.py
ajamal-python Nov 17, 2023
497182b
feat: update manager.py
ajamal-python Nov 17, 2023
a895d07
feat: update store.py
ajamal-python Nov 17, 2023
874c48d
feat: update test_factory.py
ajamal-python Nov 17, 2023
880ac48
feat: update test_manager.py
ajamal-python Nov 17, 2023
13b024d
feat: update test_store.py
ajamal-python Nov 17, 2023
a41387b
Merge branch 'master' into edx-depr32
Yagnesh1998 Nov 17, 2023
500f885
feat: Update test_api.py
Yagnesh1998 Nov 17, 2023
2b4acd4
feat: Update test_factory.py
Yagnesh1998 Nov 17, 2023
75b2b69
feat: update test_split_test.py
ajamal-python Nov 17, 2023
f7d7c18
feat: update test_api.py
ajamal-python Nov 17, 2023
0fdc838
Merge branch 'master' into edx-depr32
Yagnesh1998 Nov 17, 2023
9e49c1b
feat: update test_api.py
ajamal-python Nov 20, 2023
f5ca37a
Merge branch 'master' into edx-depr32
Yagnesh1998 Nov 20, 2023
6497074
feat: update test_tasks.py
ajamal-python Nov 20, 2023
bf3461b
Merge branch 'master' into edx-depr32
Yagnesh1998 Nov 20, 2023
6ee0687
feat: update test_field_override_performance.py
ajamal-python Nov 21, 2023
15361bd
Merge branch 'master' into edx-depr32
Yagnesh1998 Nov 21, 2023
201361d
feat: update test_tasks_helper.py
ajamal-python Nov 21, 2023
8865fdb
Merge branch 'master' into edx-depr32
Yagnesh1998 Nov 21, 2023
009ca63
feat: update test_views.py
ajamal-python Nov 21, 2023
9e3bb5c
Merge branch 'master' into edx-depr32
Yagnesh1998 Nov 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
import ddt
from django.core.management import call_command
from django.test.utils import override_settings
from edx_toggles.toggles.testutils import override_waffle_switch
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, BlockFactory

import openedx.core.djangoapps.content.block_structure.config as block_structure_config
from openedx.core.djangoapps.content.block_structure.signals import update_block_structure_on_course_publish
from cms.djangoapps.coursegraph.management.commands.dump_to_neo4j import ModuleStoreSerializer
from cms.djangoapps.coursegraph.management.commands.tests.utils import MockGraph, MockNodeMatcher
Expand Down Expand Up @@ -541,8 +539,7 @@ def test_dump_to_neo4j_published(self, mock_graph_constructor, mock_matcher_clas
assert len(submitted) == len(self.course_strings)

# simulate one of the courses being published
with override_waffle_switch(block_structure_config.STORAGE_BACKING_FOR_CACHE, True):
update_block_structure_on_course_publish(None, self.course.id)
update_block_structure_on_course_publish(None, self.course.id)

# make sure only the published course was dumped
submitted, __ = self.mss.dump_courses_to_neo4j(credentials)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def instrument_course_progress_render(
with self.assertXBlockInstantiations(1):
self.grade_course(course_key)

@ddt.data(*itertools.product(('no_overrides', 'ccx'), list(range(1, 4)), (True, False), (True, False)))
@ddt.data(*itertools.product(('no_overrides', 'ccx'), list(range(121, 4)), (True, False), (True, False)))
@ddt.unpack
@override_settings(
XBLOCK_FIELD_DATA_WRAPPERS=[],
Expand Down
46 changes: 18 additions & 28 deletions lms/djangoapps/course_api/blocks/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
"""


from itertools import product
from unittest.mock import patch

import ddt
from django.test.client import RequestFactory
from edx_toggles.toggles.testutils import override_waffle_switch

from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.content.block_structure.api import clear_course_from_cache
from openedx.core.djangoapps.content.block_structure.config import STORAGE_BACKING_FOR_CACHE
from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.tests.factories import SampleCourseFactory, check_mongo_calls # lint-amnesty, pylint: disable=wrong-import-order
Expand Down Expand Up @@ -210,33 +207,26 @@ class TestGetBlocksQueryCounts(TestGetBlocksQueryCountsBase):
"""

@ddt.data(
*product(
(ModuleStoreEnum.Type.split, ),
(True, False),
)
(ModuleStoreEnum.Type.split)
)
@ddt.unpack
def test_query_counts_cached(self, store_type, with_storage_backing):
with override_waffle_switch(STORAGE_BACKING_FOR_CACHE, active=with_storage_backing):
course = self._create_course(store_type)
self._get_blocks(
course,
expected_mongo_queries=0,
expected_sql_queries=14 if with_storage_backing else 13,
)
def test_query_counts_cached(self, store_type):
course = self._create_course(store_type)
self._get_blocks(
course,
expected_mongo_queries=4,
expected_sql_queries=20,
)

@ddt.data(
(ModuleStoreEnum.Type.split, 2, True, 23),
(ModuleStoreEnum.Type.split, 2, False, 13),
(ModuleStoreEnum.Type.split, 4, 22),
)
@ddt.unpack
def test_query_counts_uncached(self, store_type, expected_mongo_queries, with_storage_backing, num_sql_queries):
with override_waffle_switch(STORAGE_BACKING_FOR_CACHE, active=with_storage_backing):
course = self._create_course(store_type)
clear_course_from_cache(course.id)

self._get_blocks(
course,
expected_mongo_queries,
expected_sql_queries=num_sql_queries,
)
def test_query_counts_uncached(self, store_type, expected_mongo_queries, num_sql_queries):
course = self._create_course(store_type)
clear_course_from_cache(course.id)

self._get_blocks(
course,
expected_mongo_queries,
expected_sql_queries=num_sql_queries,
)
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_gated(self, gated_block_ref, gating_block_ref, expected_blocks_before_c
self.course.enable_subsection_gating = True
self.setup_gated_section(self.blocks[gated_block_ref], self.blocks[gating_block_ref])

with self.assertNumQueries(5):
with self.assertNumQueries(13):
self.get_blocks_and_check_against_expected(self.user, expected_blocks_before_completion)

# clear the request cache to simulate a new request
Expand All @@ -179,7 +179,7 @@ def test_gated(self, gated_block_ref, gating_block_ref, expected_blocks_before_c
self.user,
)

with self.assertNumQueries(6):
with self.assertNumQueries(13):
self.get_blocks_and_check_against_expected(self.user, self.ALL_BLOCKS_EXCEPT_SPECIAL)

def test_staff_access(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from unittest import mock

from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
from openedx.core.djangoapps.content.block_structure.api import clear_course_from_cache
from openedx.core.djangoapps.content.block_structure.transformers import BlockStructureTransformers

from ...api import get_course_blocks
Expand Down Expand Up @@ -41,7 +40,6 @@ def setUp(self):
self.course_hierarchy = self.get_course_hierarchy()
self.blocks = self.build_course(self.course_hierarchy)
self.course = self.blocks['course']
clear_course_from_cache(self.course.id)

# Enroll user in course.
CourseEnrollmentFactory.create(user=self.user, course_id=self.course.id, is_active=True)
Expand Down Expand Up @@ -122,7 +120,6 @@ def test_content_library(self):
)
assert len(list(raw_block_structure.get_block_keys())) == len(self.blocks)

clear_course_from_cache(self.course.id)
trans_block_structure = get_course_blocks(
self.user,
self.course.location,
Expand All @@ -146,7 +143,6 @@ def test_content_library(self):
selected_child = 'html1' if vertical2_selected else 'html2'

# Check course structure again.
clear_course_from_cache(self.course.id)
for i in range(5):
trans_block_structure = get_course_blocks(
self.user,
Expand Down Expand Up @@ -175,7 +171,6 @@ def setUp(self):
self.course_hierarchy = self.get_course_hierarchy()
self.blocks = self.build_course(self.course_hierarchy)
self.course = self.blocks['course']
clear_course_from_cache(self.course.id)

# Enroll user in course.
CourseEnrollmentFactory.create(user=self.user, course_id=self.course.id, is_active=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_user_randomly_assigned(self):
self.course.location,
self.transformers,
)
with check_mongo_calls(0):
with check_mongo_calls(4):
block_structure2 = get_course_blocks(
self.user,
self.course.location,
Expand Down
14 changes: 7 additions & 7 deletions lms/djangoapps/courseware/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,30 +1491,30 @@ def test_view_certificate_link(self):
self.assertContains(resp, "earned a certificate for this course.")

@ddt.data(
(True, 53),
(False, 53),
(True, 60),
(False, 60),
)
@ddt.unpack
def test_progress_queries_paced_courses(self, self_paced, query_count):
"""Test that query counts remain the same for self-paced and instructor-paced courses."""
# TODO: decrease query count as part of REVO-28
ContentTypeGatingConfig.objects.create(enabled=True, enabled_as_of=datetime(2018, 1, 1))
self.setup_course(self_paced=self_paced)
with self.assertNumQueries(query_count, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST), check_mongo_calls(2):
with self.assertNumQueries(query_count, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST), check_mongo_calls(3):
self._get_progress_page()

def test_progress_queries(self):
ContentTypeGatingConfig.objects.create(enabled=True, enabled_as_of=datetime(2018, 1, 1))
self.setup_course()
with self.assertNumQueries(
53, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST
), check_mongo_calls(2):
60, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST
), check_mongo_calls(3):
self._get_progress_page()

for _ in range(2):
with self.assertNumQueries(
37, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST
), check_mongo_calls(2):
44, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST
), check_mongo_calls(3):
self._get_progress_page()

@patch.dict(settings.FEATURES, {'ENABLE_CERTIFICATES_IDV_REQUIREMENT': True})
Expand Down
28 changes: 14 additions & 14 deletions lms/djangoapps/grades/tests/test_course_grade_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,35 @@ def _assert_section_order(course_grade):
self.sequence2.display_name
]

with self.assertNumQueries(4), mock_get_score(1, 2):
with self.assertNumQueries(11), mock_get_score(1, 2):
_assert_read(expected_pass=False, expected_percent=0) # start off with grade of 0

num_queries = 42
num_queries = 49
with self.assertNumQueries(num_queries), mock_get_score(1, 2):
grade_factory.update(self.request.user, self.course, force_update_subsections=True)

with self.assertNumQueries(3):
with self.assertNumQueries(10):
_assert_read(expected_pass=True, expected_percent=0.5) # updated to grade of .5

num_queries = 6
num_queries = 13
with self.assertNumQueries(num_queries), mock_get_score(1, 4):
grade_factory.update(self.request.user, self.course, force_update_subsections=False)

with self.assertNumQueries(3):
with self.assertNumQueries(10):
_assert_read(expected_pass=True, expected_percent=0.5) # NOT updated to grade of .25

num_queries = 18
num_queries = 25
with self.assertNumQueries(num_queries), mock_get_score(2, 2):
grade_factory.update(self.request.user, self.course, force_update_subsections=True)

with self.assertNumQueries(3):
with self.assertNumQueries(10):
_assert_read(expected_pass=True, expected_percent=1.0) # updated to grade of 1.0

num_queries = 28
num_queries = 35
with self.assertNumQueries(num_queries), mock_get_score(0, 0): # the subsection now is worth zero
grade_factory.update(self.request.user, self.course, force_update_subsections=True)

with self.assertNumQueries(3):
with self.assertNumQueries(10):
_assert_read(expected_pass=False, expected_percent=0.0) # updated to grade of 0.0

@ddt.data((True, False))
Expand Down Expand Up @@ -257,11 +257,11 @@ def test_all_empty_grades(self):
"""
with patch.object(
BlockStructureFactory,
'create_from_store',
wraps=BlockStructureFactory.create_from_store
) as mock_create_from_store:
'create_from_modulestore',
wraps=BlockStructureFactory.create_from_modulestore
) as mock_create_from_modulestore:
all_course_grades, all_errors = self._course_grades_and_errors_for(self.course, self.students)
assert mock_create_from_store.call_count == 1
assert mock_create_from_modulestore.call_count == 2

assert len(all_errors) == 0
for course_grade in all_course_grades.values():
Expand All @@ -286,7 +286,7 @@ def test_grading_exception(self, mock_course_grade):
else mock_course_grade.return_value
for student in self.students
]
with self.assertNumQueries(8):
with self.assertNumQueries(17):
all_course_grades, all_errors = self._course_grades_and_errors_for(self.course, self.students)
assert {student: str(all_errors[student]) for student in all_errors} == {
student3: 'Error for student3.',
Expand Down
16 changes: 8 additions & 8 deletions lms/djangoapps/grades/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ def test_triggers_subsection_score_signal(self, mock_subsection_signal):
def test_block_structure_created_only_once(self):
self.set_up_course()
with patch(
'openedx.core.djangoapps.content.block_structure.factory.BlockStructureFactory.create_from_store',
'openedx.core.djangoapps.content.block_structure.factory.BlockStructureFactory.create_from_modulestore',
side_effect=BlockStructureNotFound(self.course.location),
) as mock_block_structure_create:
self._apply_recalculate_subsection_grade()
assert mock_block_structure_create.call_count == 1
assert mock_block_structure_create.call_count == 6

@ddt.data(
(ModuleStoreEnum.Type.split, 2, 41, True),
(ModuleStoreEnum.Type.split, 2, 41, False),
(ModuleStoreEnum.Type.split, 2, 48, True),
(ModuleStoreEnum.Type.split, 2, 48, False),
)
@ddt.unpack
def test_query_counts(self, default_store, num_mongo_calls, num_sql_calls, create_multiple_subsections):
Expand All @@ -165,7 +165,7 @@ def test_query_counts(self, default_store, num_mongo_calls, num_sql_calls, creat
self._apply_recalculate_subsection_grade()

@ddt.data(
(ModuleStoreEnum.Type.split, 2, 41),
(ModuleStoreEnum.Type.split, 2, 48),
)
@ddt.unpack
def test_query_counts_dont_change_with_more_content(self, default_store, num_mongo_calls, num_sql_calls):
Expand Down Expand Up @@ -199,18 +199,18 @@ def test_other_inaccessible_subsection(self, mock_subsection_signal):

# Make sure the signal is sent for only the 2 accessible sequentials.
self._apply_recalculate_subsection_grade()
assert mock_subsection_signal.call_count == 2
assert mock_subsection_signal.call_count == 1
sequentials_signalled = {
args[1]['subsection_grade'].location
for args in mock_subsection_signal.call_args_list
}
self.assertSetEqual(
sequentials_signalled,
{self.sequential.location, accessible_seq.location},
{self.sequential.location},
)

@ddt.data(
(ModuleStoreEnum.Type.split, 2, 41),
(ModuleStoreEnum.Type.split, 2, 48),
)
@ddt.unpack
def test_persistent_grades_on_course(self, default_store, num_mongo_queries, num_sql_queries):
Expand Down
4 changes: 1 addition & 3 deletions lms/djangoapps/grades/tests/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.course_blocks.api import get_course_blocks
from lms.djangoapps.course_blocks.transformers.tests.helpers import CourseStructureTestCase
from openedx.core.djangoapps.content.block_structure.api import clear_course_from_cache

from ..transformer import GradesTransformer

Expand Down Expand Up @@ -423,7 +422,7 @@ def setUp(self):
self.client.login(username=self.student.username, password=password)

@ddt.data(
(ModuleStoreEnum.Type.split, 2, 2),
(ModuleStoreEnum.Type.split, 4, 4),
)
@ddt.unpack
def test_modulestore_performance(self, store_type, max_mongo_calls, min_mongo_calls):
Expand Down Expand Up @@ -462,6 +461,5 @@ def test_modulestore_performance(self, store_type, max_mongo_calls, min_mongo_ca
)
with self.store.default_store(store_type):
blocks = self.build_course(course)
clear_course_from_cache(blocks['course'].id)
with check_mongo_calls_range(max_mongo_calls, min_mongo_calls):
get_course_blocks(self.student, blocks['course'].location, self.transformers)
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor_task/tests/test_tasks_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def test_query_counts(self):

with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'):
with check_mongo_calls(2):
with self.assertNumQueries(50):
with self.assertNumQueries(58):
CourseGradeReport.generate(None, None, course.id, {}, 'graded')

def test_inactive_enrollments(self):
Expand Down
Loading
Loading