sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

Fix flaky `testGetCaptureFailedRequestsEnabled`

Open philipphofmann opened this issue 1 year ago • 0 comments

GitHub action Run Link

https://github.com/getsentry/sentry-cocoa/actions/runs/8520084162/job/23335548804?pr=3813

Disabling PR

https://github.com/getsentry/sentry-cocoa/pull/3814

Description

Runs successfully locally. The SentryNetworkTracker is a singleton https://github.com/getsentry/sentry-cocoa/blob/b15521ec4775f623b296e1fca558ffac46447bb8/Sources/Sentry/SentryNetworkTracker.m#L51-L57

and frequently calls methods on the SentrySDK, such as https://github.com/getsentry/sentry-cocoa/blob/b15521ec4775f623b296e1fca558ffac46447bb8/Sources/Sentry/SentryNetworkTracker.m#L445

This means the SentryNetworkTracker has some global state that is bad for testability. We could remove some of the global state to fix this flaky test.

philipphofmann avatar Apr 02 '24 09:04 philipphofmann