Skip to content

Commit 15b8888

Browse files
fix(sdk_crashes): Ignore SentrySDKInternal crash (#101790)
The CocoaSDK recently migrated SentrySDK crash to SentrySDKInternal. We also need to ignore it to avoid false positives.
1 parent def1630 commit 15b8888

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/sentry/utils/sdk_crashes/sdk_crash_detection_config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ def build_sdk_crash_detection_configs() -> Sequence[SDKCrashDetectionConfig]:
140140
module_pattern="*",
141141
function_pattern="**SentrySDK crash**",
142142
),
143+
# [SentrySDKInternal crash] is a testing function causing a crash.
144+
# Therefore, we don't want to mark it a as a SDK crash.
145+
FunctionAndModulePattern(
146+
module_pattern="*",
147+
function_pattern="**SentrySDKInternal crash**",
148+
),
143149
# SentryCrashExceptionApplicationHelper._crashOnException calls abort() intentionally, which would cause false positives.
144150
FunctionAndModulePattern(
145151
module_pattern="*",

tests/sentry/utils/sdk_crashes/test_sdk_crash_detection_cocoa.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,14 @@ def test_sentrycrash_not_reported(self, mock_sdk_crash_reporter: MagicMock) -> N
634634
mock_sdk_crash_reporter,
635635
)
636636

637+
# "+[SentrySDKInternal crash]" is used for testing, so we must ignore it.
638+
def test_sentrySDKInternal_not_reported(self, mock_sdk_crash_reporter: MagicMock) -> None:
639+
self.execute_test(
640+
get_crash_event(function="+[SentrySDKInternal crash]"),
641+
False,
642+
mock_sdk_crash_reporter,
643+
)
644+
637645
# "SentryCrashExceptionApplicationHelper _crashOnException" calls abort() intentionally, so we must ignore it.
638646
def test_sentrycrash_exception_application_helper_not_reported(
639647
self, mock_sdk_crash_reporter: MagicMock

0 commit comments

Comments
 (0)