-
Notifications
You must be signed in to change notification settings - Fork 557
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
Changes from all commits
1553d66
c8a09cc
2343a71
1bf111c
d2beba4
32a1166
784462c
1fb34b3
1ab0a56
5420bc2
1e6d7ec
3ca41a0
File filter
Filter by extension
Conversations
Jump to
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 | ||
|
||
|
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.maxsize
here? 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