pytest-django
pytest-django copied to clipboard
pytest cannot find database and tables
Moved from https://github.com/pytest-dev/pytest-xdist/issues/690
OP post:
I am trying to speed up the test runtime by using pytest-xdist, previously I was using pytest, pytest-django to run the tests,
After installing pytest-xdist, One is an issue which I am facing is most of the tests are failing with messages that relation does not exist
pytest -n auto accounts/testsfor example
psycopg2.errors.UndefinedTable: relation "auth_user" does not existI guess there is error which says database does not exist:
django.db.utils.OperationalError: FATAL: database "test_dev" does not existBut the interesting thing is some of tests are passing :(
I am having the same issue even with requesting the fixture django_db_modify_db_settings_parallel_suffix.
pytest -n auto runs 11 cores in my server, and I noticed that this problem happens less with -n 6 cores. And almost never happens with -n 2 . The issue started when we moved to a different server. The original one runs on only 2 cores with
pytest -n auto.
E django.db.utils.OperationalError: FATAL: database "test_dev_gw1" does not exist
Any news here?