Attempt to improve unit test reliability:

- synchronize mock properties on the main queue
- sleep for longer when processing routes
- finish encoding before deallocating the keyed archiver
- wait for NotificationCenter notifications to be delivered
- change were we process remote notification permissions
This commit is contained in:
Stefan Ceriu
2024-04-10 16:29:30 +03:00
committed by Stefan Ceriu
parent da598302df
commit 7645971812
6 changed files with 8825 additions and 378 deletions
@@ -155,12 +155,8 @@ class RoomFlowCoordinatorTests: XCTestCase {
private func process(route: AppRoute) async throws {
roomFlowCoordinator.handleAppRoute(route, animated: true)
if case .childRoom = route {
// A single yield isn't enough when creating the new flow coordinator.
try await Task.sleep(for: .milliseconds(100))
} else {
await Task.yield()
}
// A single yield isn't enough when creating the new flow coordinator.
try await Task.sleep(for: .milliseconds(100))
}
private func process(route: AppRoute, expectedAction: RoomFlowCoordinatorAction) async throws {