From 654f1806a50286d59fa33e8c43f83eb1390594ed Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Thu, 13 Oct 2022 18:41:43 +0200 Subject: [PATCH] test: Fix stuck tests on master branch (#2285) 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 https://github.com/getsentry/sentry-cocoa/issues/2284. --- Tests/SentryTests/TestUtils/SentryTestObserver.m | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Tests/SentryTests/TestUtils/SentryTestObserver.m b/Tests/SentryTests/TestUtils/SentryTestObserver.m index a4fb1f95073..a58619fa81b 100644 --- a/Tests/SentryTests/TestUtils/SentryTestObserver.m +++ b/Tests/SentryTests/TestUtils/SentryTestObserver.m @@ -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; }