Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest django crashing with pyest 8.0.0 #1107

Open
jacobowitz opened this issue Jan 29, 2024 · 3 comments
Open

Pytest django crashing with pyest 8.0.0 #1107

jacobowitz opened this issue Jan 29, 2024 · 3 comments

Comments

@jacobowitz
Copy link

jacobowitz commented Jan 29, 2024

We seem to have an issue in our test setup with pytest-django and the new 8.0.0 release of pytest. Just pinning pytest to the last 7.x version is a working workaround for us.

Our database setup fixture is crashing since the new pytest version was released. I am not sure which component is ultimately responsible for this bug, but I figured I could try pinging you first as it might be very well in pytest-django.

error_message
This is the error we are getting. It looks like it is trying to setup the db to often and thus generates too long database names as a side effect.

begin_stack
Begin of the stack trace

loop
pytest_django/fixtures.py:305: in handle shows up 293 times in total. Looks like some kind of recursive loop

pytest 8.0.0
Django 4.2.9
pytest-django 4.7.0
Python 3.10.13
Debian
Postgres

@bluetech
Copy link
Member

Can you show your pytest configuration and how you invoke pytest?

@bluetech
Copy link
Member

Also, does it still happen if you disable parallelism (i.e. run without using -n auto or such)?

@wrvdklooster
Copy link

We also see this sometimes after upgrading to pytest 8.0.0.

Debugged a bit and noticed after running tests for some time at a certain time in pytest-django in method django_db_modify_db_settings_xdist_suffix the value of the test database name seems wrong.

I see these values:

suffix = 'gw2'
test_name = 'test_gw2'

This means after the method returns the database name will be test_gw2_gw2.

I will try to reproduce with pytest 8.0.2 also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants