-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Set higher recusion limit (2**12) for PyPy #1984
Conversation
Interesting side note
|
Can we set the recursion limit for that single test? I think it would still be nice to make sure we handle the errors correctly. I didn't know |
We could using a fixture and
It was a good idea. However, |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1984 +/- ##
=======================================
Coverage 92.64% 92.64%
=======================================
Files 94 94
Lines 10891 10894 +3
=======================================
+ Hits 10090 10093 +3
Misses 801 801
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Let's merge this and see it that resolves the issue. |
(cherry picked from commit 68bf7d5)
😞 Doesn't look like it for #1985 and #1977 A rerun still solves it. So it doesn't look like a systematic issue with astroid. Maybe a pytest + PyPy issue? Could be that stack frames don't get released or something. Tbh I don't know enough about it though. Should we revert this change? An alternative approach could be to just skip the specific test on |
I also don't know enough about it. Might also be related to Anyway, I think reverting and then skipping the test might indeed be best here. |
Good guess! I was able to reproduce it locally after adding
I'll prepare the PRs for that. |
This reverts commit 68bf7d5.
Description
#1982 increases the number of recursions to properly determine all call variables. With the default recursion limit of
1000
, this can sometimes lead to RecursionErrors, especially onPyPy
which seems to need more steps / function calls compared to CPython.This PR increases the recursion limit to
2**12
(4096). For comparison, mypy uses2**14
(16.384).Failing CI run: https://github.com/PyCQA/astroid/actions/runs/4035944885/jobs/6938193475
Successful rerun: https://github.com/PyCQA/astroid/actions/runs/4035944885/jobs/6938237623
The test causing the error is
tests/unittest_inference.py::test_recursion_on_inference_tip
added in #1392 to test infinite recursion. AFAICT this doesn't happen here, otherwise the test would always fail. The recursion limit is just a bit low.