Skip to content

Commit

Permalink
MainThreadMonitor: increased threshold
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 committed Jun 15, 2023
1 parent 6ba378b commit b1f17c8
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 b1f17c8

Please sign in to comment.