Changes between Initial Version and Version 1 of Ticket #23746


Ignore:
Timestamp:
Nov 1, 2014, 4:25:28 PM (10 years ago)
Author:
Wojtek Ruszczewski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23746 – Description

    initial v1  
    1 The `assertNumQueries` manager / method may return different results depending on what is in various caches. Consequently, some tests using it to rely on test ordering, particularly those that count some content type queries. For instance if you [https://code.djangoproject.com/ticket/23742 run the suite in reverse] you'll see `test_group_permission_performance` failing due to `ContentType` being or not being asked about `auth.Group` in some preceding test ^[#f1 1]^.
     1The `assertNumQueries` manager / method may return different results depending on what is in various caches. Consequently, some tests using it rely on test ordering, particularly those that count some content type queries. For instance if you [https://code.djangoproject.com/ticket/23742 run the suite in reverse] you'll see `test_group_permission_performance` failing due to `ContentType` being or not being asked about `auth.Group` in some preceding test ^[#f1 1]^.
    22
    33[https://github.com/wrwrwr/django/compare/fix/assert-num-queries-cache-dependence The proposed solution] resets "query" caches on entering the manager (with a switch to disable it for actual caching tests). After introducing the change 10 tests started to fail (`ContentType` cache tests and some `prefetch_related` tests), 2 specific workarounds were no longer necessary (#17377, #20432) and a failure from [https://github.com/django/django/pull/3426 PR 3426] disappeared ^[#f2 2]^.
Back to Top