Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 664
Considerably raise DEFAULT_MAX_VALUE_LENGTH#4632
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
1553d66c8a09cc2343a711bf111cd2beba432a1166784462c1fb34b31ab0a565420bc21e6d7ec3ca41a0File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -773,14 +773,14 @@ def test_databag_string_stripping(sentry_init, capture_events, benchmark): | ||
| def inner(): | ||
| del events[:] | ||
| try: | ||
| a = "A" * 1000000 # noqa | ||
| a = "A" * DEFAULT_MAX_VALUE_LENGTH * 10 # noqa | ||
| 1 / 0 | ||
| except Exception: | ||
| capture_exception() | ||
| (event,) = events | ||
| assert len(json.dumps(event)) < 10000 | ||
| assert len(json.dumps(event)) < DEFAULT_MAX_VALUE_LENGTH * 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: String Truncation Test Assertion Too WeakThe assertion in Locations (1) | ||
| def test_databag_breadth_stripping(sentry_init, capture_events, benchmark): | ||
| @@ -1073,7 +1073,10 @@ def test_multiple_positional_args(sentry_init): | ||
| "sdk_options, expected_data_length", | ||
| [ | ||
| ({}, DEFAULT_MAX_VALUE_LENGTH), | ||
| ({"max_value_length": 1800}, 1800), | ||
| ( | ||
| {"max_value_length": DEFAULT_MAX_VALUE_LENGTH + 1000}, | ||
| DEFAULT_MAX_VALUE_LENGTH + 1000, | ||
| ), | ||
| ], | ||
| ) | ||
| def test_max_value_length_option( | ||
| @@ -1082,7 +1085,7 @@ def test_max_value_length_option( | ||
| sentry_init(sdk_options) | ||
| events = capture_events() | ||
| capture_message("a" * 2000) | ||
| capture_message("a" * (DEFAULT_MAX_VALUE_LENGTH + 2000)) | ||
| assert len(events[0]["message"]) == expected_data_length | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Why not use
sys.maxsizehere? Then, we definitely should never need to bump this limit again.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.
In any case, let's add a code comment to document how we picked the value we end up going with
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.
Talked about this offline -- and added a comment