MainThreadMonitor: fixed flakiness in CI#2517
Merged
Merged
Conversation
Fixes https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/11230/workflows/78444bf6-22b8-40fc-ad92-1f29279377d0/jobs/69663 This is meant to detect deadlocks. 1 second is unfortunately too low for CI with limited resources.
Codecov Report
@@ Coverage Diff @@
## main #2517 +/- ##
==========================================
- Coverage 87.83% 87.82% -0.01%
==========================================
Files 199 199
Lines 13647 13647
==========================================
- Hits 11987 11986 -1
- Misses 1660 1661 +1 |
NachoSoto
added a commit
that referenced
this pull request
May 25, 2023
Fixes https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/11230/workflows/78444bf6-22b8-40fc-ad92-1f29279377d0/jobs/69663 This is meant to detect deadlocks. 1 second is unfortunately too low for CI with limited resources.
This was referenced May 31, 2023
NachoSoto
added a commit
that referenced
this pull request
Jun 15, 2023
See also #2517. We keep getting flaky failures with this in CI, which is annoying because it marks the whole test run as failed and it doesn't retry. The reason for that is because we have to use `fatalError` and can't use `fail()` because this detection has to happen outside the main thread. If the main thread is blocked, well, we can't rely `XCTest` to run in the main thread. Ultimately, we can't guarantee that CI machines will be fast enough to ensure they don't get blocked. The purpose of this class was to detect deadlocks. By increasing it to 30 seconds, we pretty much avoid flaky failures for slow CI machines, but still have the ability to detect if the main thread is deadlocked due to a locking issue.
NachoSoto
added a commit
that referenced
this pull request
Jun 15, 2023
See also #2517. We keep getting flaky failures with this in CI, which is annoying because it marks the whole test run as failed and it doesn't retry. The reason for that is because we have to use `fatalError` and can't use `fail()` because this detection has to happen outside the main thread. If the main thread is blocked, well, we can't rely `XCTest` to run in the main thread. Ultimately, we can't guarantee that CI machines will be fast enough to ensure they don't get blocked. The purpose of this class was to detect deadlocks. By increasing it to 30 seconds, we pretty much avoid flaky failures for slow CI machines, but still have the ability to detect if the main thread is deadlocked due to a locking issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/11230/workflows/78444bf6-22b8-40fc-ad92-1f29279377d0/jobs/69663
This is meant to detect deadlocks. 1 second is unfortunately too low for CI with limited resources.