Skip to content

Commit

Permalink
test: Fix stuck tests on master branch (#2285)
Browse files Browse the repository at this point in the history
Some tests get stuck on the master branch which uses TestCI
configuration. The code that gets stuck is accessing UIScreen.mainScreen
in SentryCrashIntegration. This is just a workaround, the actual fix will be done
with #2284.
  • Loading branch information
philipphofmann authored Oct 13, 2022
1 parent 372ffbe commit 654f180
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Tests/SentryTests/TestUtils/SentryTestObserver.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ - (instancetype)init

// The SentryCrashIntegration enriches the scope. We need to install the integration
// once to get the scope data.
[SentrySDK startWithOptionsObject:options];

self.scope = [[SentryScope alloc] init];
[SentryCrashIntegration enrichScope:self.scope
crashWrapper:[SentryCrashWrapper sharedInstance]];
// When running the SentryTestObserver the code gets stuck when accessing the
// UIScreen.mainScreen in SentryCrashIntegration. We disable adding extra context for now.
// Ideally we somehow check here if we can access UIScreen.mainScreen, see
// https://github.com/getsentry/sentry-cocoa/issues/2284
// [SentrySDK startWithOptionsObject:options];
//
// self.scope = [[SentryScope alloc] init];
// [SentryCrashIntegration enrichScope:self.scope
// crashWrapper:[SentryCrashWrapper sharedInstance]];

self.options = options;
}
Expand Down

0 comments on commit 654f180

Please sign in to comment.