Browse Source

Fix test timing issue in ImageCacheTests

Increase delay from 1 to 2 seconds in testCleanDiskCacheWithUsedSpaceInsufficient to accommodate file writing in disk cache which has an approximate (round) creating time. This resolves CI test stability issues.
onevcat 7 months ago
parent
commit
62532adb7f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Tests/KingfisherTests/ImageCacheTests.swift

+ 1 - 1
Tests/KingfisherTests/ImageCacheTests.swift

@@ -376,7 +376,7 @@ class ImageCacheTests: XCTestCase {
                 exp.fulfill()
                 exp.fulfill()
             }
             }
 
 
-            delay(1) {
+            delay(2) { // File writing in disk cache has an approximate (round) creating time. 1 second is not enough.
                 self.cache.cleanExpiredDiskCache()
                 self.cache.cleanExpiredDiskCache()
             }
             }
         }
         }