diff --git a/Samples/SentrySampleShared/SentrySampleShared/SentrySDKOverrides.swift b/Samples/SentrySampleShared/SentrySampleShared/SentrySDKOverrides.swift index 6c2ce10687..a17b884035 100644 --- a/Samples/SentrySampleShared/SentrySampleShared/SentrySDKOverrides.swift +++ b/Samples/SentrySampleShared/SentrySampleShared/SentrySDKOverrides.swift @@ -83,7 +83,6 @@ public enum SentrySDKOverrides: String, CaseIterable { public enum Performance: String, SentrySDKOverride { case disableTimeToFullDisplayTracing = "--io.sentry.performance.disable-time-to-full-display-tracing" - case disableAppHangTrackingV2 = "--io.sentry.performance.disable-app-hang-tracking-v2" case disableSessionTracking = "--io.sentry.performance.disable-automatic-session-tracking" case disableFileIOTracing = "--io.sentry.performance.disable-file-io-tracing" case disableUIVCTracing = "--io.sentry.performance.disable-uiviewcontroller-tracing" @@ -316,7 +315,7 @@ extension SentrySDKOverrides.Other { extension SentrySDKOverrides.Performance { public var overrideType: OverrideType { switch self { - case .disableTimeToFullDisplayTracing, .disableAppHangTrackingV2, .disableSessionTracking, .disableFileIOTracing, .disableUIVCTracing, .disableCoreDataTracing, .disableANRTracking, .disableWatchdogTracking, .disableUITracing, .disablePrewarmedAppStartTracing, .disablePerformanceTracing: return .boolean + case .disableTimeToFullDisplayTracing, .disableSessionTracking, .disableFileIOTracing, .disableUIVCTracing, .disableCoreDataTracing, .disableANRTracking, .disableWatchdogTracking, .disableUITracing, .disablePrewarmedAppStartTracing, .disablePerformanceTracing: return .boolean case .sessionTrackingIntervalMillis: return .string } } @@ -403,7 +402,7 @@ extension SentrySDKOverrides.Other { extension SentrySDKOverrides.Performance { public var ignoresDisableEverything: Bool { switch self { - case .disableTimeToFullDisplayTracing, .disableAppHangTrackingV2, .disableSessionTracking, .disableFileIOTracing, .disableUIVCTracing, .disableCoreDataTracing, .disableANRTracking, .disableWatchdogTracking, .disableUITracing, .disablePrewarmedAppStartTracing, .disablePerformanceTracing: return false + case .disableTimeToFullDisplayTracing, .disableSessionTracking, .disableFileIOTracing, .disableUIVCTracing, .disableCoreDataTracing, .disableANRTracking, .disableWatchdogTracking, .disableUITracing, .disablePrewarmedAppStartTracing, .disablePerformanceTracing: return false case .sessionTrackingIntervalMillis: return true } } diff --git a/Samples/SentrySampleShared/SentrySampleShared/SentrySDKWrapper.swift b/Samples/SentrySampleShared/SentrySampleShared/SentrySDKWrapper.swift index 27f63dd10f..54039fb733 100644 --- a/Samples/SentrySampleShared/SentrySampleShared/SentrySDKWrapper.swift +++ b/Samples/SentrySampleShared/SentrySampleShared/SentrySDKWrapper.swift @@ -112,9 +112,6 @@ public struct SentrySDKWrapper { options.screenshot.maskAllText = !SentrySDKOverrides.Screenshot.disableMaskAllText.boolValue options.attachViewHierarchy = !SentrySDKOverrides.Other.disableAttachViewHierarchy.boolValue - #if !SDK_V9 - options.enableAppHangTrackingV2 = !SentrySDKOverrides.Performance.disableAppHangTrackingV2.boolValue - #endif // SDK_V9 #endif // !os(macOS) && !os(watchOS) // disable during benchmarks because we run CPU for 15 seconds at full throttle which can trigger ANRs diff --git a/Samples/iOS-Swift/iOS-Swift-UITests/ViewLifecycleUITests.swift b/Samples/iOS-Swift/iOS-Swift-UITests/ViewLifecycleUITests.swift index f1581ae535..681c158bbf 100644 --- a/Samples/iOS-Swift/iOS-Swift-UITests/ViewLifecycleUITests.swift +++ b/Samples/iOS-Swift/iOS-Swift-UITests/ViewLifecycleUITests.swift @@ -11,7 +11,7 @@ class ViewLifecycleUITests: BaseUITest { super.setUp() launchApp(args: [ SentrySDKOverrides.Performance.disableTimeToFullDisplayTracing.rawValue, - SentrySDKOverrides.Performance.disableAppHangTrackingV2.rawValue + SentrySDKOverrides.Performance.disableANRTracking.rawValue ]) } diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 81c54501a5..96da6aaf49 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -639,18 +639,11 @@ typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions *_Nonnull /** * When enabled, the SDK tracks when the application stops responding for a specific amount of - * time defined by the @c appHangsTimeoutInterval option. - * @note The default is @c YES - * @note ANR tracking is automatically disabled if a debugger is attached. - */ -@property (nonatomic, assign) BOOL enableAppHangTracking; - -#if SENTRY_UIKIT_AVAILABLE - -# if !SDK_V9 -/** - * AppHangTrackingV2 can differentiate between fully-blocking and non-fully blocking app hangs. - * fully-blocking app hang is when the main thread is stuck completely, and the app can't render a + * time defined by the @c appHangTimeoutInterval option. + * + * On iOS, tvOS and visionOS, the SDK can differentiate between fully-blocking and non-fully + blocking app hangs. + * A fully-blocking app hang is when the main thread is stuck completely, and the app can't render a * single frame. A non-fully-blocking app hang is when the app appears stuck to the user but can still * render a few frames. Fully-blocking app hangs are more actionable because the stacktrace shows @@ -661,20 +654,18 @@ typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions *_Nonnull * * You can use @c enableReportNonFullyBlockingAppHangs to ignore non-fully-blocking app hangs. * - * @note This flag wins over enableAppHangTracking. When enabling both enableAppHangTracking and - enableAppHangTrackingV2, the SDK only enables enableAppHangTrackingV2 and disables - enableAppHangTracking. + * @note The default is @c YES + * @note App Hang tracking is automatically disabled if a debugger is attached. */ -@property (nonatomic, assign) BOOL enableAppHangTrackingV2; +@property (nonatomic, assign) BOOL enableAppHangTracking; -# endif // !SDK_V9 +#if SENTRY_UIKIT_AVAILABLE /** * When enabled the SDK reports non-fully-blocking app hangs. A non-fully-blocking app hang is when - * the app appears stuck to the user but can still render a few frames. For more information see @c - * enableAppHangTrackingV2. + * the app appears stuck to the user but can still render a few frames. * - * @note The default is @c YES. This feature only works when @c enableAppHangTrackingV2 is enabled. + * @note The default is @c YES. */ @property (nonatomic, assign) BOOL enableReportNonFullyBlockingAppHangs; diff --git a/Sources/Sentry/SentryANRTrackingIntegration.m b/Sources/Sentry/SentryANRTrackingIntegration.m index ee751db88e..1e64ae5f9a 100644 --- a/Sources/Sentry/SentryANRTrackingIntegration.m +++ b/Sources/Sentry/SentryANRTrackingIntegration.m @@ -45,14 +45,8 @@ - (BOOL)installWithOptions:(SentryOptions *)options } #if SENTRY_HAS_UIKIT -# if SDK_V9 - BOOL isV2Enabled = YES; -# else - BOOL isV2Enabled = options.enableAppHangTrackingV2; -# endif // SDK_V9 self.tracker = - [SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval - isV2Enabled:isV2Enabled]; + [SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval]; #else self.tracker = [SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval]; @@ -157,48 +151,29 @@ - (void)anrDetectedWithType:(enum SentryANRType)type getDebugImagesFromCacheForThreads:SENTRY_UNWRAP_NULLABLE(NSArray, event.threads)]; #if SENTRY_HAS_UIKIT -# if SDK_V9 - BOOL isV2Enabled = YES; -# else - BOOL isV2Enabled = self.options.enableAppHangTrackingV2; -# endif // SDK_V9 - - // We only measure app hang duration for V2. - // For V1, we directly capture the app hang event. - if (isV2Enabled) { - // We only temporarily store the app hang duration info, so we can change the error message - // when either sending a normal or fatal app hang event. Otherwise, we would have to rely on - // string parsing to retrieve the app hang duration info from the error message. - mechanism.data = @{ SentryANRMechanismDataAppHangDuration : appHangDurationInfo }; - - // We need to apply the scope now because if the app hang turns into a fatal one, - // we would lose the scope. Furthermore, we want to know in which state the app was when the - // app hang started. - SentryScope *scope = [SentrySDKInternal currentHub].scope; - SentryOptions *options = SentrySDKInternal.options; - if (scope != nil && options != nil) { - [scope applyToEvent:event maxBreadcrumb:options.maxBreadcrumbs]; - } - - [self.fileManager storeAppHangEvent:event]; - } else { -#endif // SENTRY_HAS_UIKIT - [SentrySDK captureEvent:event]; -#if SENTRY_HAS_UIKIT + // We only temporarily store the app hang duration info, so we can change the error message + // when either sending a normal or fatal app hang event. Otherwise, we would have to rely on + // string parsing to retrieve the app hang duration info from the error message. + mechanism.data = @{ SentryANRMechanismDataAppHangDuration : appHangDurationInfo }; + + // We need to apply the scope now because if the app hang turns into a fatal one, + // we would lose the scope. Furthermore, we want to know in which state the app was when the + // app hang started. + SentryScope *scope = [SentrySDKInternal currentHub].scope; + SentryOptions *options = SentrySDKInternal.options; + if (scope != nil && options != nil) { + [scope applyToEvent:event maxBreadcrumb:options.maxBreadcrumbs]; } -#endif // SENTRY_UIKIT_AVAILABLE + + [self.fileManager storeAppHangEvent:event]; +#else + [SentrySDK captureEvent:event]; +#endif } - (void)anrStoppedWithResult:(SentryANRStoppedResult *_Nullable)result { #if SENTRY_HAS_UIKIT - // We only measure app hang duration for V2, and therefore ignore V1. -# if !SDK_V9 - if (!self.options.enableAppHangTrackingV2) { - return; - } -# endif // !SDK_V9 - if (result == nil) { SENTRY_LOG_WARN(@"ANR stopped for V2 but result was nil.") return; diff --git a/Sources/Sentry/SentryBaseIntegration.m b/Sources/Sentry/SentryBaseIntegration.m index 00864952de..148c1f61f7 100644 --- a/Sources/Sentry/SentryBaseIntegration.m +++ b/Sources/Sentry/SentryBaseIntegration.m @@ -77,17 +77,10 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options if (integrationOptions & kIntegrationOptionEnableAppHangTracking) { #if SENTRY_HAS_UIKIT -# if SDK_V9 if (!options.enableAppHangTracking) { [self logWithOptionName:@"enableAppHangTracking"]; return NO; } -# else - if (!options.enableAppHangTracking && !options.enableAppHangTrackingV2) { - [self logWithOptionName:@"enableAppHangTracking && enableAppHangTrackingV2"]; - return NO; - } -# endif #else if (!options.enableAppHangTracking) { [self logWithOptionName:@"enableAppHangTracking"]; @@ -176,26 +169,20 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options } #endif - // The frames tracker runs when tracing is enabled or AppHangsV2. We have to use an extra option - // for this. if (integrationOptions & kIntegrationOptionStartFramesTracker) { #if SENTRY_HAS_UIKIT BOOL performanceDisabled = !options.enableAutoPerformanceTracing || !options.isTracingEnabled; - BOOL appHangsV2Disabled = options.isAppHangTrackingV2Disabled; -# if SDK_V9 - // The V9 watchdog tracker uses the frames tracker, so frame tracking + BOOL appHangsDisabled = options.isAppHangTrackingDisabled; + + // The watchdog tracker uses the frames tracker, so frame tracking // must be enabled if watchdog tracking is enabled. BOOL watchdogDisabled = !options.enableWatchdogTerminationTracking; -# else - // Before V9 this should have no effect so set it to YES - BOOL watchdogDisabled = YES; -# endif // SDK_V9 - - if (performanceDisabled && appHangsV2Disabled && watchdogDisabled) { - if (appHangsV2Disabled) { - SENTRY_LOG_DEBUG(@"Not going to enable %@ because enableAppHangTrackingV2 is " + + if (performanceDisabled && appHangsDisabled && watchdogDisabled) { + if (appHangsDisabled) { + SENTRY_LOG_DEBUG(@"Not going to enable %@ because enableAppHangTracking is " @"disabled or the appHangTimeoutInterval is 0.", self.integrationName); } @@ -206,14 +193,12 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options self.integrationName); } -# if SDK_V9 if (watchdogDisabled) { SENTRY_LOG_DEBUG( @"Not going to enable %@ because enableWatchdogTerminationTracking " @"is disabled.", self.integrationName); } -# endif // SKD_V9 return NO; } diff --git a/Sources/Sentry/SentryDependencyContainer.m b/Sources/Sentry/SentryDependencyContainer.m index a70bafd17c..18b633768c 100644 --- a/Sources/Sentry/SentryDependencyContainer.m +++ b/Sources/Sentry/SentryDependencyContainer.m @@ -244,6 +244,16 @@ - (SentryCrashSwift *)crashReporter SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK - (SentryANRTracker *)getANRTracker:(NSTimeInterval)timeout SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK { +#if SENTRY_HAS_UIKIT + SENTRY_LAZY_INIT(_anrTracker, + [[SentryANRTracker alloc] + initWithHelper:[[SentryANRTrackerV2 alloc] + initWithTimeoutInterval:timeout + crashWrapper:self.crashWrapper + dispatchQueueWrapper:self.dispatchQueueWrapper + threadWrapper:self.threadWrapper + framesTracker:self.framesTracker]]); +#else SENTRY_LAZY_INIT(_anrTracker, [[SentryANRTracker alloc] initWithHelper:[[SentryANRTrackerV1 alloc] @@ -251,27 +261,10 @@ - (SentryANRTracker *)getANRTracker:(NSTimeInterval)timeout crashWrapper:self.crashWrapper dispatchQueueWrapper:self.dispatchQueueWrapper threadWrapper:self.threadWrapper]]); + ; +#endif } -#if SENTRY_HAS_UIKIT -- (SentryANRTracker *)getANRTracker:(NSTimeInterval)timeout - isV2Enabled:(BOOL)isV2Enabled SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK -{ - if (isV2Enabled) { - SENTRY_LAZY_INIT(_anrTracker, - [[SentryANRTracker alloc] - initWithHelper:[[SentryANRTrackerV2 alloc] - initWithTimeoutInterval:timeout - crashWrapper:self.crashWrapper - dispatchQueueWrapper:self.dispatchQueueWrapper - threadWrapper:self.threadWrapper - framesTracker:self.framesTracker]]); - } else { - return [self getANRTracker:timeout]; - } -} -#endif // SENTRY_HAS_UIKIT - #if SENTRY_TARGET_REPLAY_SUPPORTED - (nonnull SentryScreenshotSource *)screenshotSource SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK { diff --git a/Sources/Sentry/SentryOptions.m b/Sources/Sentry/SentryOptions.m index 365cad45a9..48ebc47c3c 100644 --- a/Sources/Sentry/SentryOptions.m +++ b/Sources/Sentry/SentryOptions.m @@ -101,9 +101,6 @@ - (instancetype)init self.enableUserInteractionTracing = YES; self.idleTimeout = SentryTracerDefaultTimeout; self.enablePreWarmedAppStartTracing = NO; -# if !SDK_V9 - self.enableAppHangTrackingV2 = NO; -# endif // !SDK_V9 self.enableReportNonFullyBlockingAppHangs = YES; #endif // SENTRY_HAS_UIKIT @@ -458,14 +455,9 @@ - (void)setEnableSpotlight:(BOOL)value } #if SENTRY_HAS_UIKIT -- (BOOL)isAppHangTrackingV2Disabled +- (BOOL)isAppHangTrackingDisabled { -# if SDK_V9 - BOOL isV2Enabled = self.enableAppHangTracking; -# else - BOOL isV2Enabled = self.enableAppHangTrackingV2; -# endif // SDK_V9 - return !isV2Enabled || self.appHangTimeoutInterval <= 0; + return !self.enableAppHangTracking || self.appHangTimeoutInterval <= 0; } #endif // SENTRY_HAS_UIKIT diff --git a/Sources/Sentry/SentryProfiler.mm b/Sources/Sentry/SentryProfiler.mm index 7f0a0b7cb9..5906fae1e9 100644 --- a/Sources/Sentry/SentryProfiler.mm +++ b/Sources/Sentry/SentryProfiler.mm @@ -247,10 +247,10 @@ - (void)stopForReason:(SentryProfilerTruncationReason)reason BOOL autoPerformanceTracingDisabled = ![[[[SentrySDKInternal currentHub] getClient] options] enableAutoPerformanceTracing]; - BOOL appHangsV2Disabled = - [[[[SentrySDKInternal currentHub] getClient] options] isAppHangTrackingV2Disabled]; + BOOL appHangsDisabled = + [[[[SentrySDKInternal currentHub] getClient] options] isAppHangTrackingDisabled]; - if (autoPerformanceTracingDisabled && appHangsV2Disabled) { + if (autoPerformanceTracingDisabled && appHangsDisabled) { sentry_stopFramesTracker(); } # endif // SENTRY_HAS_UIKIT diff --git a/Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m b/Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m index a20d27df83..f824a1cd4b 100644 --- a/Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m +++ b/Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m @@ -74,15 +74,8 @@ - (BOOL)installWithOptions:(SentryOptions *)options [self.tracker start]; -# if SDK_V9 - BOOL isV2Enabled = YES; -# else - BOOL isV2Enabled = options.enableAppHangTrackingV2; -# endif // SDK_V9 - self.anrTracker = - [SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval - isV2Enabled:isV2Enabled]; + [SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval]; [self.anrTracker addListener:self]; self.appStateManager = appStateManager; diff --git a/Sources/Sentry/SentyOptionsInternal.m b/Sources/Sentry/SentyOptionsInternal.m index 3c01d98759..244dfb9c6a 100644 --- a/Sources/Sentry/SentyOptionsInternal.m +++ b/Sources/Sentry/SentyOptionsInternal.m @@ -280,11 +280,6 @@ + (BOOL)validateOptions:(NSDictionary *)options [self setBool:options[@"enablePreWarmedAppStartTracing"] block:^(BOOL value) { sentryOptions.enablePreWarmedAppStartTracing = value; }]; -# if !SDK_V9 - [self setBool:options[@"enableAppHangTrackingV2"] - block:^(BOOL value) { sentryOptions.enableAppHangTrackingV2 = value; }]; -# endif // !SDK_V9 - [self setBool:options[@"enableReportNonFullyBlockingAppHangs"] block:^(BOOL value) { sentryOptions.enableReportNonFullyBlockingAppHangs = value; }]; diff --git a/Sources/Sentry/include/HybridPublic/SentryDependencyContainer.h b/Sources/Sentry/include/HybridPublic/SentryDependencyContainer.h index 24232a4ee4..d4b074b438 100644 --- a/Sources/Sentry/include/HybridPublic/SentryDependencyContainer.h +++ b/Sources/Sentry/include/HybridPublic/SentryDependencyContainer.h @@ -107,9 +107,6 @@ SENTRY_NO_INIT @property (nonatomic, strong) SentryDebugImageProvider *debugImageProvider; - (SentryANRTracker *)getANRTracker:(NSTimeInterval)timeout; -#if SENTRY_HAS_UIKIT -- (SentryANRTracker *)getANRTracker:(NSTimeInterval)timeout isV2Enabled:(BOOL)isV2Enabled; -#endif // SENTRY_HAS_UIKIT - (nullable id)application; diff --git a/Sources/Sentry/include/SentryOptions+Private.h b/Sources/Sentry/include/SentryOptions+Private.h index caf3caf05b..fae56bbbcd 100644 --- a/Sources/Sentry/include/SentryOptions+Private.h +++ b/Sources/Sentry/include/SentryOptions+Private.h @@ -53,7 +53,7 @@ FOUNDATION_EXPORT NSString *const kSentryDefaultEnvironment; SENTRY_EXTERN BOOL sentry_isValidSampleRate(NSNumber *sampleRate); #if SENTRY_HAS_UIKIT -- (BOOL)isAppHangTrackingV2Disabled; +- (BOOL)isAppHangTrackingDisabled; #endif // SENTRY_HAS_UIKIT @end diff --git a/Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift b/Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift index df1ab72dcb..c88d089ace 100644 --- a/Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift +++ b/Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift @@ -38,14 +38,6 @@ import Foundation if options.swiftAsyncStacktraces { features.append("swiftAsyncStacktraces") } - -#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) - #if !SDK_V9 - if options.enableAppHangTrackingV2 { - features.append("appHangTrackingV2") - } - #endif // !SDK_V9 -#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) if options.enablePersistingTracesWhenCrashing { features.append("persistingTracesWhenCrashing") diff --git a/Tests/SentryProfilerTests/SentryContinuousProfilerTests.swift b/Tests/SentryProfilerTests/SentryContinuousProfilerTests.swift index b88b5b8685..b1c3e40ccb 100644 --- a/Tests/SentryProfilerTests/SentryContinuousProfilerTests.swift +++ b/Tests/SentryProfilerTests/SentryContinuousProfilerTests.swift @@ -80,15 +80,7 @@ final class SentryContinuousProfilerTests: XCTestCase { #if !os(macOS) - func testStopsFramesTracker_WhenAutoPerformanceAndAppHangsV2Disabled() throws { - fixture.options.enableAutoPerformanceTracing = false - try performContinuousProfilingTest() - - XCTAssertFalse(SentryDependencyContainer.sharedInstance().framesTracker.isRunning) - } - func testDoesNotStopFramesTracker_WhenAppHangsV2Enabled() throws { - fixture.options.enableAppHangTrackingV2 = true try performContinuousProfilingTest() XCTAssertTrue(SentryDependencyContainer.sharedInstance().framesTracker.isRunning) diff --git a/Tests/SentryTests/Helper/SentryDependencyContainerTests.swift b/Tests/SentryTests/Helper/SentryDependencyContainerTests.swift index df7de98c92..8942f8e4b5 100644 --- a/Tests/SentryTests/Helper/SentryDependencyContainerTests.swift +++ b/Tests/SentryTests/Helper/SentryDependencyContainerTests.swift @@ -20,50 +20,24 @@ final class SentryDependencyContainerTests: XCTestCase { } func testGetANRTrackerV2() { - let instance = SentryDependencyContainer.sharedInstance().getANRTracker(2.0, isV2Enabled: true) + let instance = SentryDependencyContainer.sharedInstance().getANRTracker(2.0) XCTAssertTrue(instance.helper is SentryANRTrackerV2) SentryDependencyContainer.reset() } - - func testGetANRTrackerV1() { - let instance = SentryDependencyContainer.sharedInstance().getANRTracker(2.0, isV2Enabled: false) - XCTAssertTrue(instance.helper is SentryANRTrackerV1) - - SentryDependencyContainer.reset() - } - - func testGetANRTrackerV2AndThenV1_FirstCalledVersionStaysTheSame() { - let instance1 = SentryDependencyContainer.sharedInstance().getANRTracker(2.0, isV2Enabled: true) - XCTAssertTrue(instance1.helper is SentryANRTrackerV2) - - let instance2 = SentryDependencyContainer.sharedInstance().getANRTracker(2.0, isV2Enabled: false) - XCTAssertTrue(instance2.helper is SentryANRTrackerV2) - - SentryDependencyContainer.reset() - } - - func testGetANRTrackerV1AndThenV2_FirstCalledVersionStaysTheSame() { - let instance1 = SentryDependencyContainer.sharedInstance().getANRTracker(2.0, isV2Enabled: false) - XCTAssertTrue(instance1.helper is SentryANRTrackerV1) - - let instance2 = SentryDependencyContainer.sharedInstance().getANRTracker(2.0, isV2Enabled: true) - XCTAssertTrue(instance2.helper is SentryANRTrackerV1) - - SentryDependencyContainer.reset() - } - #endif - func testGetANRTracker_ReturnsV1() { - +#if os(macOS) + func testGetANRTrackerV1() { let instance = SentryDependencyContainer.sharedInstance().getANRTracker(2.0) XCTAssertTrue(instance.helper is SentryANRTrackerV1) SentryDependencyContainer.reset() } +#endif // os(macOS) + /** * This test helps to find threading issues. If you run it once it detects obvious threading issues. Some rare edge cases * only happen if you run this 1000 times in a row or increase the test iterations to 100k. @@ -121,7 +95,7 @@ final class SentryDependencyContainerTests: XCTestCase { XCTAssertNotNil(SentryDependencyContainer.sharedInstance().getANRTracker(2.0)) #if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) - XCTAssertNotNil(SentryDependencyContainer.sharedInstance().getANRTracker(2.0, isV2Enabled: true)) + XCTAssertNotNil(SentryDependencyContainer.sharedInstance().getANRTracker(2.0)) #endif // os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) XCTAssertNotNil(SentryDependencyContainer.sharedInstance().dispatchFactory) diff --git a/Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift b/Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift index 1e5735ace9..9b3848f5e4 100644 --- a/Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift +++ b/Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift @@ -35,10 +35,6 @@ final class SentryEnabledFeaturesBuilderTests: XCTestCase { #endif // canImport(UIKit) #endif // os(iOS) || os(tvOS) -#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) - options.enableAppHangTrackingV2 = true -#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) - // -- Act -- let features = SentryEnabledFeaturesBuilder.getEnabledFeatures(options: options) @@ -56,10 +52,6 @@ final class SentryEnabledFeaturesBuilderTests: XCTestCase { XCTAssert(features.contains("preWarmedAppStartTracing")) #endif // canImport(UIKit) #endif // os(iOS) || os(tvOS) - -#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) - XCTAssert(features.contains("appHangTrackingV2")) -#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) } func testEnablePersistingTracesWhenCrashing() { diff --git a/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift b/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift index eb65b5c99e..05110250a9 100644 --- a/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift +++ b/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift @@ -48,12 +48,16 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { XCTAssertNil(Dynamic(sut).tracker.asAnyObject) } - func testWhenNoDebuggerAttached_TrackerInitialized() { + func testWhenNoDebuggerAttached_TrackerInitialized() throws { givenInitializedTracker() - let tracker = Dynamic(sut).tracker.asAnyObject - XCTAssertNotNil(tracker as? SentryANRTracker) - XCTAssertTrue((tracker as? SentryANRTracker)?.helper is SentryANRTrackerV1) + let tracker = try XCTUnwrap(Dynamic(sut).tracker.asAnyObject as? SentryANRTracker) + +#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) + XCTAssertTrue(tracker.helper is SentryANRTrackerV2, "Expected SentryANRTrackerV2, but got \(type(of: tracker))") +#else + XCTAssertTrue(tracker.helper is SentryANRTrackerV1, "Expected SentryANRTrackerV1 on macOS, but got \(type(of: tracker))") +#endif } func test_enableAppHangsTracking_Disabled() { @@ -76,24 +80,9 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { XCTAssertFalse(result) } - -#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) - func test_enableAppHangTrackingV2_UsesV2Tracker() { - let options = Options() - options.enableAppHangTracking = true - options.enableAppHangTrackingV2 = true - - sut = SentryANRTrackingIntegration() - let result = sut.install(with: options) - XCTAssertTrue(result) - let tracker = Dynamic(sut).tracker.asAnyObject - XCTAssertNotNil(tracker as? SentryANRTracker) - XCTAssertTrue((tracker as? SentryANRTracker)?.helper is SentryANRTrackerV2) - } -#endif - - func testANRDetected_EventCaptured() throws { +#if os(macOS) + func testV1_ANRDetected_EventCaptured() throws { setUpThreadInspector() givenInitializedTracker() @@ -134,7 +123,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { } } - func testANRDetected_FullyBlocking_EventCaptured() throws { + func testV1_ANRDetected_FullyBlocking_EventCaptured() throws { setUpThreadInspector() givenInitializedTracker() @@ -175,7 +164,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { } } - func testANRDetected_NonFullyBlocked_EventCaptured() throws { + func testV1_ANRDetected_NonFullyBlocked_EventCaptured() throws { setUpThreadInspector() givenInitializedTracker() @@ -217,7 +206,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { } } - func testANRDetectedV1_Unknown_EventCaptured() throws { + func testV1_ANRDetected_Unknown_EventCaptured() throws { setUpThreadInspector() givenInitializedTracker() @@ -258,7 +247,24 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { XCTAssertEqual(eventDebugImage.uuid, TestData.debugImage.uuid) } } - + + func testANRDetected_DetectingPausedResumed_EventCaptured() throws { + givenInitializedTracker() + setUpThreadInspector() + sut.pauseAppHangTracking() + sut.resumeAppHangTracking() + + Dynamic(sut).anrDetectedWithType(SentryANRType.unknown) + + try assertEventWithScopeCaptured { event, _, _ in + XCTAssertNotNil(event) + let ex = try XCTUnwrap(event?.exceptions?.first, "ANR Exception not found") + + XCTAssertEqual(ex.mechanism?.type, "AppHang") + } + } +#endif // os(macOS) + #if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) func testANRDetected_NonFullyBlockedDisabled_EventNotCaptured() throws { fixture.options.enableReportNonFullyBlockingAppHangs = false @@ -280,26 +286,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { assertNoEventCaptured() } - - func testANRDetected_DetectingPausedResumed_EventCaptured() throws { - givenInitializedTracker() - setUpThreadInspector() - sut.pauseAppHangTracking() - sut.resumeAppHangTracking() - - Dynamic(sut).anrDetectedWithType(SentryANRType.unknown) - - try assertEventWithScopeCaptured { event, _, _ in - XCTAssertNotNil(event) - guard let ex = event?.exceptions?.first else { - XCTFail("ANR Exception not found") - return - } - - XCTAssertEqual(ex.mechanism?.type, "AppHang") - } - } - + func testCallPauseResumeOnMultipleThreads_DoesNotCrash() { givenInitializedTracker() @@ -359,7 +346,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRDetected_DoesNotCaptureEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() // Act Dynamic(sut).anrDetectedWithType(SentryANRType.nonFullyBlocking) @@ -371,7 +358,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRStopped_DoesCaptureEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.fullyBlocking) @@ -433,7 +420,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2Detected_PauseCalled_ANRStopped_DoesCaptureEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.fullyBlocking) @@ -492,7 +479,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRStopped_EmptyEventStored_DoesCaptureEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.fullyBlocking) @@ -509,7 +496,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRDetected_StopNotCalled_SendsFatalANROnNextInstall() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.nonFullyBlocking) @@ -519,7 +506,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { } // Act - givenInitializedTracker(enableV2: true) + givenInitializedTracker() // Assert try assertFatalEventWithScope { event, _ in @@ -549,13 +536,13 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRDetected_PauseCalledButStopNotCalled_SendsFatalANROnNextInstall() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.nonFullyBlocking) sut.pauseAppHangTracking() // Act - givenInitializedTracker(enableV2: true) + givenInitializedTracker() sut.pauseAppHangTracking() // Assert @@ -586,7 +573,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRDetected_StopNotCalledAndAbnormalSession_SendsFatalAppHangOnNextInstall() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.nonFullyBlocking) @@ -600,7 +587,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { SentrySDKInternal.currentHub().client()?.fileManager.storeAbnormalSession(abnormalSession) // Act - givenInitializedTracker(enableV2: true) + givenInitializedTracker() // Assert let client = try XCTUnwrap(SentrySDKInternal.currentHub().getClient() as? TestClient) @@ -637,12 +624,12 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRDetected_StopNotCalledAndCrashed_SendsNormalAppHangEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.fullyBlocking) // Act - givenInitializedTracker(crashedLastLaunch: true, enableV2: true) + givenInitializedTracker(crashedLastLaunch: true) // Assert try assertEventWithScopeCaptured { event, scope, _ in @@ -659,12 +646,12 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_StoredApHangEventWithNoException_NoEventCaptured() throws { // Arrange - givenInitializedTracker(enableV2: true) + givenInitializedTracker() let event = Event() SentrySDKInternal.currentHub().client()?.fileManager.storeAppHang(event) // Act - givenInitializedTracker(enableV2: true) + givenInitializedTracker() // Assert assertNoEventCaptured() @@ -673,7 +660,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRStopped_DoesDeleteTheAppHangEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.fullyBlocking) let result = SentryANRStoppedResult(minDuration: 1.849, maxDuration: 2.251) @@ -692,7 +679,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRStopped_ButEventDeleted_DoesNotCaptureEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() Dynamic(sut).anrDetectedWithType(SentryANRType.nonFullyBlocking) SentrySDKInternal.currentHub().client()?.fileManager.deleteAppHangEvent() @@ -708,7 +695,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { func testV2_ANRStoppedWithNilResult_DoesNotCaptureEvent() throws { // Arrange setUpThreadInspector() - givenInitializedTracker(enableV2: true) + givenInitializedTracker() // Act Dynamic(sut).anrStoppedWithResult(nil) @@ -735,7 +722,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { XCTAssertFalse(Event().isAppHangEvent) } - private func givenInitializedTracker(isBeingTraced: Bool = false, crashedLastLaunch: Bool = false, enableV2: Bool = false) { + private func givenInitializedTracker(isBeingTraced: Bool = false, crashedLastLaunch: Bool = false) { givenSdkWithHub() SentrySDK.configureScope { scope in @@ -748,11 +735,6 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { self.crashWrapper.internalIsBeingTraced = isBeingTraced self.crashWrapper.internalCrashedLastLaunch = crashedLastLaunch sut = SentryANRTrackingIntegration() -#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) - if enableV2 { - self.options.enableAppHangTrackingV2 = true - } -#endif // os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) sut.install(with: self.options) } diff --git a/Tests/SentryTests/Integrations/Performance/FramesTracking/SentryFramesTrackingIntegrationTests.swift b/Tests/SentryTests/Integrations/Performance/FramesTracking/SentryFramesTrackingIntegrationTests.swift index 7c867bd664..a5b8cfca49 100644 --- a/Tests/SentryTests/Integrations/Performance/FramesTracking/SentryFramesTrackingIntegrationTests.swift +++ b/Tests/SentryTests/Integrations/Performance/FramesTracking/SentryFramesTrackingIntegrationTests.swift @@ -48,18 +48,17 @@ class SentryFramesTrackingIntegrationTests: XCTestCase { XCTAssertNotNil(Dynamic(sut).tracker.asObject) } - func testAppHangV2Enabled_MeasuresFrames() { + func testAppHangEnabled_MeasuresFrames() { let options = fixture.options - options.enableAppHangTrackingV2 = true sut.install(with: options) XCTAssertNotNil(Dynamic(sut).tracker.asObject) } - func testAppHangV2Enabled_ButIntervalZero_DoestNotMeasuresFrames() { + func testAppHangEnabled_ButIntervalZero_DoestNotMeasuresFrames() { let options = fixture.options - options.enableAppHangTrackingV2 = true options.appHangTimeoutInterval = 0.0 + options.enableWatchdogTerminationTracking = false sut.install(with: options) XCTAssertNil(Dynamic(sut).tracker.asObject) @@ -68,6 +67,8 @@ class SentryFramesTrackingIntegrationTests: XCTestCase { func testZeroTracesSampleRate_DoesNotMeasureFrames() { let options = fixture.options options.tracesSampleRate = 0.0 + options.appHangTimeoutInterval = 0.0 + options.enableWatchdogTerminationTracking = false sut.install(with: options) XCTAssertNil(Dynamic(sut).tracker.asObject) @@ -77,6 +78,8 @@ class SentryFramesTrackingIntegrationTests: XCTestCase { let options = fixture.options options.tracesSampleRate = 0.1 options.enableAutoPerformanceTracing = false + options.enableAppHangTracking = false + options.enableWatchdogTerminationTracking = false sut.install(with: options) XCTAssertNil(Dynamic(sut).tracker.asObject) @@ -102,14 +105,5 @@ class SentryFramesTrackingIntegrationTests: XCTestCase { XCTAssertNil(fixture.displayLink.target) XCTAssertNil(fixture.displayLink.selector) } - - func test_FramesTracking_Disabled() { - let options = Options() - options.enableAutoPerformanceTracing = false - - let result = fixture.sut.install(with: options) - - XCTAssertFalse(result) - } } #endif diff --git a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationTrackerTests.swift b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationTrackerTests.swift index 4ba07a4f48..ce4cf0f725 100644 --- a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationTrackerTests.swift +++ b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationTrackerTests.swift @@ -123,13 +123,16 @@ class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase { sut.start() goToForeground() - - XCTAssertTrue(fixture.fileManager.readAppState()?.isActive ?? false) - + + let appState1 = try XCTUnwrap(fixture.fileManager.readAppState()) + XCTAssertTrue(appState1.isActive, "Expected appSate to be active after going to foreground.") + goToBackground() - - XCTAssertFalse(fixture.fileManager.readAppState()?.isActive ?? true) - XCTAssertEqual(3, fixture.dispatchQueue.dispatchAsyncCalled) + + let appState2 = try XCTUnwrap(fixture.fileManager.readAppState()) + XCTAssertFalse(appState2.isActive, "Expected appSate to be inactive after going to background.") + + XCTAssertGreaterThanOrEqual(fixture.dispatchQueue.dispatchAsyncCalled, 3, "Expected at least 3 dispatchAsync calls (start, foreground, background) to ensure we don't run reading the app state on the calling thread. ") } func testGoToForeground_WhenAppStateNil_NothingIsStored() { diff --git a/Tests/SentryTests/SentryClientTests.swift b/Tests/SentryTests/SentryClientTests.swift index ce14980e7d..c9c6156d4f 100644 --- a/Tests/SentryTests/SentryClientTests.swift +++ b/Tests/SentryTests/SentryClientTests.swift @@ -1711,12 +1711,15 @@ class SentryClientTests: XCTestCase { let eventId = fixture.getSut().capture(message: fixture.messageAsString) eventId.assertIsNotEmpty() - + var expectedIntegrations = ["AutoBreadcrumbTracking", "AutoSessionTracking", "Crash", "NetworkTracking"] if !SentryDependencyContainer.sharedInstance().crashWrapper.isBeingTraced { expectedIntegrations = ["ANRTracking"] + expectedIntegrations } - +#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) + expectedIntegrations.append("FramesTracking") +#endif // os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) + let actual = try lastSentEvent() assertArrayEquals( expected: expectedIntegrations, @@ -1755,7 +1758,10 @@ class SentryClientTests: XCTestCase { if !SentryDependencyContainer.sharedInstance().crashWrapper.isBeingTraced { expectedIntegrations = ["ANRTracking"] + expectedIntegrations } - +#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) + expectedIntegrations.append("FramesTracking") +#endif // os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) + assertArrayEquals( expected: expectedIntegrations, actual: actual.sdk?["integrations"] as? [String] diff --git a/Tests/SentryTests/SentryOptionsTest.m b/Tests/SentryTests/SentryOptionsTest.m index 91eedc5b79..7686135be6 100644 --- a/Tests/SentryTests/SentryOptionsTest.m +++ b/Tests/SentryTests/SentryOptionsTest.m @@ -966,11 +966,6 @@ - (void)testEnableAppHangTracking #if SENTRY_UIKIT_AVAILABLE -- (void)testEnableAppHangTrackingV2 -{ - [self testBooleanField:@"enableAppHangTrackingV2" defaultValue:NO]; -} - - (void)testEnableReportNonFullyBlockingAppHangs { [self testBooleanField:@"enableReportNonFullyBlockingAppHangs" defaultValue:YES]; @@ -1491,32 +1486,17 @@ - (void)testSpotlightUrl } #if SENTRY_HAS_UIKIT -- (void)testIsAppHangTrackingV2Disabled_WhenBothOptionsDisabled -{ - SentryOptions *options = [self - getValidOptions:@{ @"enableAppHangTrackingV2" : @NO, @"appHangTimeoutInterval" : @0 }]; - XCTAssertTrue(options.isAppHangTrackingV2Disabled); -} - -- (void)testIsAppHangTrackingV2Disabled_WhenOnlyEnableAppHangTrackingV2Disabled +- (void)testIsAppHangTrackingDisabled_WhenOptionDisabled { - SentryOptions *options = [self - getValidOptions:@{ @"enableAppHangTrackingV2" : @NO, @"appHangTimeoutInterval" : @2.0 }]; - XCTAssertTrue(options.isAppHangTrackingV2Disabled); + SentryOptions *options = [self getValidOptions:@{ @"appHangTimeoutInterval" : @0 }]; + XCTAssertTrue(options.isAppHangTrackingDisabled); } -- (void)testIsAppHangTrackingV2Disabled_WhenOnlyAppHangTimeoutIntervalZero +- (void)testIsAppHangTrackingDisabled_WhenOnlyAppHangTimeoutIntervalZero { - SentryOptions *options = [self - getValidOptions:@{ @"enableAppHangTrackingV2" : @YES, @"appHangTimeoutInterval" : @0 }]; - XCTAssertTrue(options.isAppHangTrackingV2Disabled); -} - -- (void)testIsAppHangTrackingV2Disabled_WhenBothOptionsEnabled -{ - SentryOptions *options = [self - getValidOptions:@{ @"enableAppHangTrackingV2" : @YES, @"appHangTimeoutInterval" : @2.0 }]; - XCTAssertFalse(options.isAppHangTrackingV2Disabled); + SentryOptions *options = + [self getValidOptions:@{ @"enableAppHangTracking" : @YES, @"appHangTimeoutInterval" : @0 }]; + XCTAssertTrue(options.isAppHangTrackingDisabled); } #endif // SENTRY_HAS_UIKIT diff --git a/Tests/SentryTests/SentrySDKTests.swift b/Tests/SentryTests/SentrySDKTests.swift index 17c6d12808..384fb1ff21 100644 --- a/Tests/SentryTests/SentrySDKTests.swift +++ b/Tests/SentryTests/SentrySDKTests.swift @@ -146,6 +146,9 @@ class SentrySDKTests: XCTestCase { if !SentryDependencyContainer.sharedInstance().crashWrapper.isBeingTraced { expectedIntegrations.append("SentryANRTrackingIntegration") } +#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) + expectedIntegrations.append("SentryFramesTrackingIntegration") +#endif // os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) assertIntegrationsInstalled(integrations: expectedIntegrations) }