Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#20432 closed Bug (fixed)

GroupAdminTest.test_group_permission_performance fail on full test suite run

Reported by: otherjacob Owned by: Aymeric Augustin <aymeric.augustin@…>
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


the test passes when running all the admin_views tests in isolation, but fails when running with test suite.

Final pass of running the test against --bisect produces this:

FAIL: test_group_permission_performance (admin_views.tests.GroupAdminTest)

Traceback (most recent call last):

File "/Users/jacob/git/django/tests/admin_views/", line 3660, in test_group_permission_performance

self.assertEqual(response.status_code, 200)

File "/Users/jacob/git/django/django/test/", line 181, in exit

executed, self.num

AssertionError: 7 queries executed, 8 expected

Ran 190 tests in 6.069s

FAILED (failures=1, skipped=2)
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
* Problem found in second half. Bisecting again...
* Source of error: django.contrib.auth

Change History (3)

comment:1 Changed 6 years ago by Łukasz Langa

The missing query is

  {'sql': 'QUERY = \'SELECT "django_content_type"."id", "django_content_type"."name", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."model" = %s  AND "django_content_type"."app_label" = %s )\' - PARAMS = (\'group\', \'auth\')', 'time': '0.000'},

ContentTypeManager caches get_for_model() queries. Another test caches the Group content type.

comment:2 Changed 6 years ago by Aymeric Augustin <aymeric.augustin@…>

Owner: set to Aymeric Augustin <aymeric.augustin@…>
Resolution: fixed
Status: newclosed

In 340115200f459d02e9a3e61c9704653215e185d5:

Fixed #20432 -- Test failure in admin_views.

The failure was triggered by a cache leak.

comment:3 Changed 5 years ago by Tim Graham <timograham@…>

In 7cd3f1c29595d1da7f37d29e7c3bc6a7a314cd1d:

Fixed cache state dependence for assertNumQueries in test_group_permission_performance.

Refs #20432 and #23746.

Note: See TracTickets for help on using tickets.
Back to Top