Code

#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

Description

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/tests.py", line 3660, in test_group_permission_performance

self.assertEqual(response.status_code, 200)

File "/Users/jacob/git/django/django/test/testcases.py", 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

Attachments (0)

Change History (2)

comment:1 Changed 11 months ago by ambv

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 11 months ago by Aymeric Augustin <aymeric.augustin@…>

  • Owner set to Aymeric Augustin <aymeric.augustin@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 340115200f459d02e9a3e61c9704653215e185d5:

Fixed #20432 -- Test failure in admin_views.

The failure was triggered by a cache leak.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.