[Django] #30964: macOS test failure

17 views
Skip to first unread message

Django

unread,
Nov 7, 2019, 9:32:39 PM11/7/19
to django-...@googlegroups.com
#30964: macOS test failure
-------------------------------------+-------------------------------------
Reporter: Johannes | Owner: nobody
Hoppe |
Type: Bug | Status: new
Component: Database | Version: 2.2
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 |
-------------------------------------+-------------------------------------
This bug was discovered during GitHub action trails, while running the
test suite agianst macOS, see also:
https://github.com/codingjoe/django/runs/292481675

{{{

FAIL: test_db_table (schema.tests.SchemaTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/runner/runners/2.160.0/work/django/django/django/test/utils.py",
line 370, in inner
return func(*args, **kwargs)
File
"/Users/runner/runners/2.160.0/work/django/django/tests/schema/tests.py",
line 2249, in test_db_table
self.assertForeignKeyExists(Book, "author_id", "schema_otherauthor")
File
"/Users/runner/runners/2.160.0/work/django/django/tests/schema/tests.py",
line 207, in assertForeignKeyExists
self.assertEqual(constraint_fk, (expected_fk_table, field))
AssertionError: Tuples differ: ('schema_author', 'id') !=
('schema_otherauthor', 'id')

First differing element 0:
'schema_author'
'schema_otherauthor'

- ('schema_author', 'id')
+ ('schema_otherauthor', 'id')
? +++++


----------------------------------------------------------------------
Ran 13209 tests in 487.293s
}}}

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

Django

unread,
Nov 7, 2019, 10:36:50 PM11/7/19
to django-...@googlegroups.com
#30964: macOS test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

Comment (by Simon Charette):

Pretty sure this is related to the SQLite version installed.

What does `python -c"import sqlite3; print(sqlite3.version_info,
sqlite3.sqlite_version)"` yield?

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

Django

unread,
Nov 7, 2019, 10:46:18 PM11/7/19
to django-...@googlegroups.com
#30964: macOS test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: new

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

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

Comment (by Simon Charette):

Probably want to `brew install sqlite` as well at
https://github.com/codingjoe/django/blob/f67edd20b80de813d55f5df79c0d0c6134e8b754/.github/workflows/ci.yml#L52

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

Django

unread,
Nov 8, 2019, 9:23:37 AM11/8/19
to django-...@googlegroups.com
#30964: macOS test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: closed

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

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

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


Comment:

This passed for me with SQLite 3.24, so I'm going to close assuming that
the SQLite version is the underlying cause.

It's probably `invalid` but I'll give it a `needsinfo` since
7444f3252757ed4384623e5afd7dcfeef3e0c74e added a `check_sqlite_version()`
which raises `if Database.sqlite_version_info < (3, 8, 3)` — so the
version in play must be higher that that — maybe there's room for a
cleanup here, if you can follow-up Joe 🤔
(No worries if not.)

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

Django

unread,
Nov 8, 2019, 9:25:10 AM11/8/19
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------

Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:4>

Django

unread,
Nov 8, 2019, 11:57:16 PM11/8/19
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: new

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

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

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


Comment:

Hold your horses, it's version 3.28.0 which should be supported, right?


{{{
Run python -c "import sqlite3; print(sqlite3.sqlite_version)"
3.28.0
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:5>

Django

unread,
Nov 10, 2019, 12:08:53 AM11/10/19
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: new

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

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

* cc: Simon Charette (added)


Comment:

It should indeed be supported but I can't reproduce on macOS Mojave with
3.28.0.

Did `brew install sqlite` help anyhow?

--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:6>

Django

unread,
Nov 10, 2019, 2:57:00 AM11/10/19
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: new

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

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

Comment (by Johannes Hoppe):

@Simon

{{{
$ brew update
$ brew install sqlite
Warning: sqlite 3.30.1 is already installed and up-to-date
To reinstall 3.30.1, run `brew reinstall sqlite`
}}}

Interestingly enough `sqlite3.sqlite_version` is still 3.28.0.
In am not 100% sure this is a sqlite issue. This could also be something
OS related. Which would make sense considering that it apears to happen
only on macOS.

--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:7>

Django

unread,
Nov 10, 2019, 6:39:01 AM11/10/19
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master

(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

* version: 2.2 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:8>

Django

unread,
Nov 15, 2019, 6:15:49 AM11/15/19
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: new

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

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

Comment (by Carlton Gibson):

Hey Joe:

> Interestingly enough sqlite3.sqlite_version is still 3.28.0.

You have to tell Python where to find your SQLite. The internet suggests
LD_LIBRARY_PATH, but on macOS I find you have to set DYLD_LIBRARY_PATH:

{{{
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/sqlite/3.28.1/lib
}}}

Simon has a variation on those instructions here: https://github.com/orf
/django-docker-box/issues/25

--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:9>

Django

unread,
Nov 19, 2019, 5:31:28 AM11/19/19
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------

Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: closed

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

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

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


Comment:

OK, I can't reproduce the issue here. I'll keep an eye on it but, short of
more concrete steps, or someone else confirming, I'm not sure what we can
do.

--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:10>

Django

unread,
Mar 29, 2020, 5:36:27 AM3/29/20
to django-...@googlegroups.com
#30964: macOS/SQLite test failure
-------------------------------------+-------------------------------------

Reporter: Johannes Hoppe | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

* resolution: needsinfo => invalid


Comment:

Thanks Carlton,

I was able to resolve this failure by:
- installing SQLite 3.31.1 using `brew install sqlite`
- Setting `export DYLD_LIBRARY_PATH=/usr/local/Cellar/sqlite/3.31.1/lib`
in the shell startup file (`~/.bashrc` in my case)

''Resolved as `invalid`''

Quick question - Should we add this in the Troubleshooting section of
Contributing guidelines -
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/unit-tests/#troubleshooting?

--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:11>

Reply all
Reply to author
Forward
0 new messages