-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Getting a AttributeError: _instance
when running tests on CircleCI
#12865
Comments
@MayankJ1403 it might be a bug but I'm afraid I'll need some more information. Are you able to narrow it down to a specific test? Does the test do anything unusual? Are there any other pytest plugins in use except I'd say this error can occur in one of two ways:
I'm guessing it's the first one. If you can isolate where it fails that would be most helpful. |
I can provide a "scrubbed" variant of the test since the code is private. For context, we are using django-tenant-schemas as well which has largely remained unmainted for a long time. it could be the case that Pytest v8.2+ has some breakages for DTS specifically.
Whats strange is that when I run this test specifically locally or if I run the collection of tests from the specific CircleCI container locally, it works just fine. But it breaks on CircleCI. I've tried to debug if there are any environmental differences between the two and they are identical in config. Another thing I've noticed is that if I upgrade to v8.2.2, I face a different error
The plugins I am using are ( From the pytest output )
Another thing too is that this a flaky nature of test cases. Sometimes it will pass and sometimes it will fail. I understand that this kind of flakiness can largely be caused due to test ordering which points to some incorrect handling of data from one test class to another that may affect this but I was just curious if there are any obvious blockers here that I can identify |
Are you able to reproduce without (BTW, you probably aren't using |
We are using |
Try using it then? If you can reproduce on CI but not locally, and you use rerunfailures on CI but not locally, it seems like a good next step to try getting your local configuration closer to what you do on CI? |
I tried this. Since we were using The changelogs for |
I did find an ongoing thread for |
Closing this issue at this time because its likely a compatibility issue w/ rerunfailures. Thanks for your help @bluetech @The-Compiler |
Hey @bluetech, Been following some of the changelogs and have seen a couple of your changes go thru for Pytest and pytest-django.
I am trying to upgrade my Pytest version from 8.1.1 to 8.3.3 and my pytest-django version from 4.8.0 to 4.9.0.
When I'm running the tests locally, everything works as expected but on CircleCI, I am getting a rather weird stack trace
I was hoping you may have some idea around this because i'd seen some of the discussion threads you were involved in regarding the unittest changes in 8.2.0 and the latest release for
pytest-django
4.9.0The versions used locally AND CircleCI are
pytest - v8.3.3
pytest-django v4.9.0
python 3.9.18
postgres 12.18
Django - 4.2.15
django-tenant-schemas 1.12.0
The earlier versions where the pipeline was running fine was
pytest - v8.1.1.
pytest-django v4.8.0
python 3.9.18
postgres 12.18
Django - 4.2.15
django-tenant-schemas 1.12.0
The text was updated successfully, but these errors were encountered: