Skip to content

Commit

Permalink
MainThreadMonitor: increased threshold (#2662)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NachoSoto authored Jun 15, 2023
1 parent 6ba378b commit fe31904
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Tests/BackendIntegrationTests/MainThreadMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class MainThreadMonitor {
}
}

private static let threshold: DispatchTimeInterval = .seconds(5)
private static let threshold: DispatchTimeInterval = .seconds(30)

}

Expand Down

0 comments on commit fe31904

Please sign in to comment.