Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/sentry/seer/similarity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ def get_stacktrace_string(data: dict[str, Any], platform: str | None = None) ->
if (
platform not in SYSTEM_FRAME_CHECK_BLACKLIST_PLATFORMS
and frame_metrics["is_frames_truncated"]
and not app_hash
):
raise TooManyOnlySystemFramesException

Expand Down Expand Up @@ -412,7 +411,7 @@ def get_stacktrace_string_with_metrics(
metrics.incr(
key,
sample_rate=sample_rate,
tags={"call_made": False, "blocker": "over-threshold-only-system-frames"},
tags={"call_made": False, "blocker": "over-threshold-frames"},
)
except Exception:
logger.exception("Unexpected exception in stacktrace string formatting")
Expand Down
10 changes: 5 additions & 5 deletions tests/sentry/grouping/ingest/test_seer.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def test_returns_no_grouphash_and_empty_metadata_if_empty_stacktrace(
)

@patch("sentry.seer.similarity.utils.metrics")
def test_too_many_only_system_frames(self, mock_metrics: Mock) -> None:
def test_too_many_frames(self, mock_metrics: Mock) -> None:
type = "FailedToFetchError"
value = "Charlie didn't bring the ball back"
context_line = f"raise {type}('{value}')"
Expand Down Expand Up @@ -391,12 +391,12 @@ def test_too_many_only_system_frames(self, mock_metrics: Mock) -> None:
sample_rate=1.0,
tags={
"call_made": False,
"blocker": "over-threshold-only-system-frames",
"blocker": "over-threshold-frames",
},
)

@patch("sentry.seer.similarity.utils.metrics")
def test_too_many_only_system_frames_invalid_platform(self, mock_metrics: Mock) -> None:
def test_too_many_frames_allowed_platform(self, mock_metrics: Mock) -> None:
type = "FailedToFetchError"
value = "Charlie didn't bring the ball back"
context_line = f"raise {type}('{value}')"
Expand Down Expand Up @@ -441,7 +441,7 @@ def test_too_many_only_system_frames_invalid_platform(self, mock_metrics: Mock)
sample_rate=1.0,
tags={
"call_made": False,
"blocker": "over-threshold-only-system-frames",
"blocker": "over-threshold-frames",
},
)
not in mock_metrics.incr.call_args_list
Expand Down Expand Up @@ -561,7 +561,7 @@ def test_too_many_only_system_frames_maybe_check_seer_for_matching_group_hash(
sample_rate=1.0,
tags={
"call_made": False,
"blocker": "over-threshold-only-system-frames",
"blocker": "over-threshold-frames",
},
)

Expand Down
12 changes: 6 additions & 6 deletions tests/sentry/seer/similarity/test_utils.py
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding platform=javascript is because we allow sending more than 30 frames for these tests.

Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def test_chained_too_many_frames(self):
),
),
]
stacktrace_str = get_stacktrace_string(data_chained_exception)
stacktrace_str = get_stacktrace_string(data_chained_exception, platform="javascript")

# The stacktrace string should be:
# 25 frames from OuterExcepton (with lines counting up from 1 to 25), followed by
Expand Down Expand Up @@ -614,7 +614,7 @@ def test_chained_too_many_frames_all_minified_js(self):
),
),
]
stacktrace_str = get_stacktrace_string(data_chained_exception)
stacktrace_str = get_stacktrace_string(data_chained_exception, platform="javascript")

# The stacktrace string should be:
# 15 frames from OuterExcepton (with lines counting up from 1 to 15), followed by
Expand Down Expand Up @@ -668,7 +668,7 @@ def test_chained_too_many_frames_minified_js_frame_limit(self):
),
),
]
stacktrace_str = get_stacktrace_string(data_chained_exception)
stacktrace_str = get_stacktrace_string(data_chained_exception, platform="javascript")

assert (
stacktrace_str.count("outer line")
Expand All @@ -688,7 +688,7 @@ def test_chained_too_many_exceptions(self):
)
for i in range(1, MAX_FRAME_COUNT + 2)
]
stacktrace_str = get_stacktrace_string(data_chained_exception)
stacktrace_str = get_stacktrace_string(data_chained_exception, platform="javascript")
for i in range(2, MAX_FRAME_COUNT + 2):
assert f"exception {i} message!" in stacktrace_str
assert "exception 1 message!" not in stacktrace_str
Expand Down Expand Up @@ -784,7 +784,7 @@ def test_too_many_in_app_contributing_frames(self):
data_frames["app"]["component"]["values"][0]["values"][0]["values"] += self.create_frames(
20, True, 41
)
stacktrace_str = get_stacktrace_string(data_frames, "java")
stacktrace_str = get_stacktrace_string(data_frames, platform="javascript")

num_frames = 0
for i in range(1, 11):
Expand Down Expand Up @@ -812,7 +812,7 @@ def test_too_many_frames_minified_js_frame_limit(self):
),
),
]
stacktrace_str = get_stacktrace_string(data_frames)
stacktrace_str = get_stacktrace_string(data_frames, platform="javascript")

assert stacktrace_str.count("context line") == expected_frame_count

Expand Down
Loading