Skip to content

Commit

Permalink
Improve tab lazy loading test reliability (#3645)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1199230911884351/1208926119997580/f
Tech Design URL:
CC:

Description:

This is an experimental change to improve some CI reliability, after successfully reproducing failures locally and then applying this fix to resolve them. So far, I haven't seen another failure locally after a half dozen runs, whereas before I could reproduce this almost every time.
  • Loading branch information
samsymons authored Dec 6, 2024
1 parent 9fa4333 commit 8ab609c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion UnitTests/Sync/SyncPreferencesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ final class SyncPreferencesTests: XCTestCase {

@MainActor func testOnTurnOffSyncThenSyncServiceIsDisconnected() async {
let expectation = XCTestExpectation(description: "Disconnect completed")
Task {
Task { @MainActor in
syncPreferences.turnOffSync()
XCTAssertNil(managementDialogModel.currentDialog)
await Task.yield()
expectation.fulfill()
}
await fulfillment(of: [expectation], timeout: 5.0)
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/TabBar/ViewModel/TabLazyLoaderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class TabLazyLoaderTests: XCTestCase {
lazyLoader?.scheduleLazyLoading()

// Then
waitForExpectations(timeout: 0.3)
waitForExpectations(timeout: 3.0)
XCTAssertEqual(didFinishEvents.count, 1)
XCTAssertEqual(try XCTUnwrap(didFinishEvents.first), true)
}
Expand Down

0 comments on commit 8ab609c

Please sign in to comment.