Skip to content

Commit 0dab942

Browse files
Change timeout
1 parent b7882ae commit 0dab942

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/unit-tests/AuthTests.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class AuthTests: XCTestCase {
378378
})
379379

380380
let expirationRefreshPeriod: TimeInterval = 0
381-
let waitTime: TimeInterval = 2
381+
let waitTime: TimeInterval = 1.0
382382
let expirationTimeSinceEpoch = Date(timeIntervalSinceNow: expirationRefreshPeriod + waitTime).timeIntervalSince1970
383383
let mockEncodedPayload = createMockEncodedPayload(exp: Int(expirationTimeSinceEpoch))
384384

@@ -405,7 +405,7 @@ class AuthTests: XCTestCase {
405405
})
406406

407407
let expirationRefreshPeriod: TimeInterval = 0
408-
let waitTime: TimeInterval = 2
408+
let waitTime: TimeInterval = 1.0
409409
let expirationTimeSinceEpoch = Date(timeIntervalSinceNow: expirationRefreshPeriod + waitTime).timeIntervalSince1970
410410
let mockEncodedPayload = createMockEncodedPayload(exp: Int(expirationTimeSinceEpoch))
411411

@@ -595,7 +595,7 @@ class AuthTests: XCTestCase {
595595

596596
class AsyncAuthDelegate: IterableAuthDelegate {
597597
func onAuthTokenRequested(completion: @escaping AuthTokenRetrievalHandler) {
598-
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
598+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
599599
completion(AuthTests.authToken)
600600
}
601601
}
@@ -670,7 +670,7 @@ class AuthTests: XCTestCase {
670670

671671
class AsyncAuthDelegate: IterableAuthDelegate {
672672
func onAuthTokenRequested(completion: @escaping AuthTokenRetrievalHandler) {
673-
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
673+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
674674
completion(AuthTests.authToken)
675675
}
676676
}
@@ -698,7 +698,7 @@ class AuthTests: XCTestCase {
698698
})
699699

700700
wait(for: [condition1], timeout: testExpectationTimeout)
701-
wait(for: [condition2], timeout: 3)
701+
wait(for: [condition2], timeout: 1.0)
702702
}
703703

704704
func testAuthTokenNotRequestingForAlreadyExistingEmail() {
@@ -789,10 +789,8 @@ class AuthTests: XCTestCase {
789789
)
790790
api.userId = "some-user-id"
791791
api.track("some-event").onSuccess { _ in
792-
print("success")
793792
expectation2.fulfill()
794793
}.onError { error in
795-
print("error, \(error)")
796794
XCTFail()
797795
}
798796
wait(for: [expectation1, expectation2], timeout: testExpectationTimeout)

0 commit comments

Comments
 (0)