Przeglądaj źródła

Loose some time sensitive tests

onevcat 5 lat temu
rodzic
commit
028973fe58

+ 1 - 1
Tests/KingfisherTests/DiskStorageTests.swift

@@ -115,7 +115,7 @@ class DiskStorageTests: XCTestCase {
         let now = Date()
         try! storage.store(value: "1", forKey: "1", expiration: .seconds(2))
         XCTAssertTrue(storage.isCached(forKey: "1"))
-        XCTAssertFalse(storage.isCached(forKey: "1", referenceDate: now.addingTimeInterval(3)))
+        XCTAssertFalse(storage.isCached(forKey: "1", referenceDate: now.addingTimeInterval(5)))
 
         delay(1) {
             let v = try! self.storage.value(forKey: "1")

+ 1 - 1
Tests/KingfisherTests/ImageCacheTests.swift

@@ -288,7 +288,7 @@ class ImageCacheTests: XCTestCase {
                 self.cache.cleanExpiredDiskCache()
             }
         }
-        waitForExpectations(timeout: 2, handler: nil)
+        waitForExpectations(timeout: 5, handler: nil)
     }
     
     func testCannotRetrieveCacheWithProcessorIdentifier() {

+ 1 - 1
Tests/KingfisherTests/KingfisherManagerTests.swift

@@ -422,7 +422,7 @@ class KingfisherManagerTests: XCTestCase {
                 exp.fulfill()
             }
         }
-        waitForExpectations(timeout: 3, handler: nil)
+        waitForExpectations(timeout: 5, handler: nil)
     }
     
     func testCouldProcessOnOriginalImageWithOriginalCache() {

+ 2 - 2
Tests/KingfisherTests/MemoryStorageTests.swift

@@ -262,7 +262,7 @@ class MemoryStorageTests: XCTestCase {
         XCTAssertEqual(
             obj.estimatedExpiration.timeIntervalSince1970,
             now.addingTimeInterval(1).timeIntervalSince1970,
-            accuracy: 0.2)
+            accuracy: 0.3)
 
         let exp = expectation(description: #function)
         delay(0.5) {
@@ -270,7 +270,7 @@ class MemoryStorageTests: XCTestCase {
             XCTAssertEqual(
                 obj.estimatedExpiration.timeIntervalSince1970,
                 now.addingTimeInterval(1.5).timeIntervalSince1970,
-                accuracy: 0.2)
+                accuracy: 0.3)
             exp.fulfill()
         }
         waitForExpectations(timeout: 3, handler: nil)