Skip to content

Commit 2369d22

Browse files
warmup cache better
1 parent 30ea6c9 commit 2369d22

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

unittests/test_importers_performance.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Finding,
1919
Product,
2020
Product_Type,
21+
Test,
2122
User,
2223
)
2324

@@ -44,7 +45,7 @@ def setUp(self):
4445
# As part of the test suite the ContentTYpe ids will already be cached and won't affect the query count.
4546
# But if we run the test in isolation, the ContentType ids will not be cached and will result in more queries.
4647
# By warming up the cache here, these queries are executed before we start counting queries
47-
for model in [Development_Environment, Dojo_User, Endpoint, Endpoint_Status, Engagement, Finding, Product, Product_Type, User]:
48+
for model in [Development_Environment, Dojo_User, Endpoint, Endpoint_Status, Engagement, Finding, Product, Product_Type, User, Test]:
4849
ContentType.objects.get_for_model(model)
4950

5051
@contextmanager
@@ -153,7 +154,7 @@ def import_reimport_performance(self, expected_num_queries1, expected_num_async_
153154

154155
def test_import_reimport_reimport_performance(self):
155156
self.import_reimport_performance(
156-
expected_num_queries1=604,
157+
expected_num_queries1=603,
157158
expected_num_async_tasks1=15,
158159
expected_num_queries2=489,
159160
expected_num_async_tasks2=23,

0 commit comments

Comments
 (0)