[Django] #29813: backends.base.test_operations.DatabaseOperationTests fails on MySQL in isolation

8 views
Skip to first unread message

Django

unread,
Oct 2, 2018, 1:24:14 AM10/2/18
to django-...@googlegroups.com
#29813: backends.base.test_operations.DatabaseOperationTests fails on MySQL in
isolation
-------------------------------------+-------------------------------------
Reporter: Jon | Owner: nobody
Dufresne |
Type: Bug | Status: new
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When running the Django test
`backends.base.test_operations.DatabaseOperationTests` in isolation with a
MySQL configuration, it fails with the following error:

{{{
======================================================================
FAIL: test_window_frame_raise_not_supported_error
(backends.base.test_operations.DatabaseOperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".../django/django/test/testcases.py", line 1114, in skip_wrapper
if condition():
File ".../django/django/test/testcases.py", line 1135, in <lambda>
lambda: any(getattr(connection.features, feature, False) for feature
in features),
File ".../django/django/test/testcases.py", line 1135, in <genexpr>
lambda: any(getattr(connection.features, feature, False) for feature
in features),
File ".../django/django/utils/functional.py", line 37, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File ".../django/django/db/backends/mysql/features.py", line 84, in
supports_over_clause
if self.connection.mysql_is_mariadb:
File ".../django/django/utils/functional.py", line 37, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File ".../django/django/db/backends/mysql/base.py", line 344, in
mysql_is_mariadb
return 'mariadb' in self.mysql_server_info.lower()
File ".../django/django/utils/functional.py", line 37, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File ".../django/django/db/backends/mysql/base.py", line 330, in
mysql_server_info
with self.temporary_connection() as cursor:
File "/usr/lib64/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File ".../django/django/db/backends/base/base.py", line 577, in
temporary_connection
with self.cursor() as cursor:
File ".../django/django/test/testcases.py", line 144, in __call__
"set %s.allow_database_queries to True to silence this failure." %
self.cls_name
AssertionError: Database queries aren't allowed in SimpleTestCase. Either
use TestCase or TransactionTestCase to ensure proper test isolation or set
DatabaseOperationTests.allow_database_queries to True to silence this
failure.
}}}

The test is using `SimpleTestCase`, but this test executes a query on
MySQL for feature detection.

--
Ticket URL: <https://code.djangoproject.com/ticket/29813>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 2, 2018, 1:35:26 AM10/2/18
to django-...@googlegroups.com
#29813: backends.base.test_operations.DatabaseOperationTests fails on MySQL in
isolation
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jon Dufresne):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/10463 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/29813#comment:1>

Django

unread,
Oct 2, 2018, 8:23:27 AM10/2/18
to django-...@googlegroups.com
#29813: backends.base.test_operations.DatabaseOperationTests fails on MySQL in
isolation
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"f0759305d03be544f0fc147811c1c461b5978624" f0759305]:
{{{
#!CommitTicketReference repository=""
revision="f0759305d03be544f0fc147811c1c461b5978624"
[2.1.x] Fixed #29813 -- Fixed DatabaseOperation test when run in isolation
on MySQL.

Backport of 7598cd4748dc402b0209e5eedb6d2a83c3da1620 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29813#comment:2>

Django

unread,
Oct 2, 2018, 8:23:27 AM10/2/18
to django-...@googlegroups.com
#29813: backends.base.test_operations.DatabaseOperationTests fails on MySQL in
isolation
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"7598cd4748dc402b0209e5eedb6d2a83c3da1620" 7598cd47]:
{{{
#!CommitTicketReference repository=""
revision="7598cd4748dc402b0209e5eedb6d2a83c3da1620"


Fixed #29813 -- Fixed DatabaseOperation test when run in isolation on
MySQL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29813#comment:3>

Reply all
Reply to author
Forward
0 new messages