Skip to content

Commit d2ea3e3

Browse files
committed
Fixing testStartFetchWithMaxTimestamp() that was failing sometimes
1 parent 8a7add6 commit d2ea3e3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libs/MobileSync/MobileSyncTests/BriefcaseSyncDownTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ class BriefcaseSyncDownTests: SyncManagerTestCase {
6363
let records = try startFetch(target: target, syncManager: syncManager, maxTimestamp: timestamp)
6464
XCTAssert(records.isEmpty)
6565

66+
// Timestamp are rounded to the second so sleep so we need to sleep a bit
67+
// before creating new accounts
68+
Thread.sleep(forTimeInterval: 1.0)
69+
6670
// Make records newer than timestamp
6771
let newAccounts = try XCTUnwrap(createRecords(onServer: numberAccounts, objectType: ACCOUNT_TYPE))
6872
XCTAssertEqual(Int(numberAccounts), newAccounts.count)

0 commit comments

Comments
 (0)