-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: large snapshot diff recursion error #776
Conversation
"python.linting.pylintEnabled": true, | ||
"python.linting.pylintEnabled": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pylint not used in project
snapshot_collection, key=lambda s: cls._snapshot_sort_key(s) # type: ignore # noqa: E501 | ||
snapshot_collection, | ||
key=cls._snapshot_sort_key, # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linter flagged as redundant
"field_7": {False, "no", 0, None}, # noqa: disable=B033 | ||
"field_7": {False, "no", None}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was adding no value just confusion
## [4.0.7](v4.0.6...v4.0.7) (2023-07-20) ### Bug Fixes * large snapshot diff recursion error ([#776](#776)) ([24260b1](24260b1))
🎉 This PR is included in version 4.0.7 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Description
Avoids the recursion error limit in
difflib.ndiff
by truncating the checked lines to a subsection of the diff.inv install
Related Issues
Fixes RecursionError raised by _fancy_replace for a large snapshot #577
Helps Add option to disable snapshot diffing #581, Tests hang when diffing moderately sized binary file #625
Checklist
Additional Comments
Went with the simple approach of just checking from the first mismatch and giving a large enough buffer to catch meaningful differences.
Can be validated by setting the
DIFF_LINE_COUNT_LIMIT
to a high value e.g.100000
and running tests, maybe a follow up can make this configurable;