#34222: Django unit tests hang when running against a Postgres database
---------------------------------------------+------------------------
Reporter: Adrian Garcia | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
I am trying to get the
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/unit-tests/ Django library tests] running so I can develop a custom
backend and everything works fine with the default SQLite settings file,
but when I provide one for Postgres random tests will hang with no error.
To debug, I am running the test suite with {{{runtests.py --noinput
--parallel=1 -v 2 --settings test_postgres}}}
test_postgres.py:
{{{
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "postgres",
"USER": "user",
"PASSWORD": "password",
"HOST": "127.0.0.1",
"PORT": "5432",
},
"other": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "postgres",
"USER": "user",
"PASSWORD": "password",
"HOST": "127.0.0.1",
"PORT": "5432",
},
}
SECRET_KEY = "django_tests_secret_key"
# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = [
"django.contrib.auth.hashers.MD5PasswordHasher",
]
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
USE_TZ = False
}}}
Am I doing something wrong, or do these test cases hang for others? I
cloned the 4.1.x repo and reset it to 2ff479f to specifically test against
Django 4.1.4 and it consistently crashes *after*
`multiple_database.tests.AuthTestCase` runs. If I get it working, I'll
compile a list of test classes I have to skip to get the tests to run
through without hanging.
--
Ticket URL: <https://code.djangoproject.com/ticket/34222>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070185356bdd53-3d20903b-5623-474c-950e-f615b12cf9b8-000000%40eu-central-1.amazonses.com.