Просмотр исходного кода

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 месяцев назад
Родитель
Сommit
62532adb7f
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Tests/KingfisherTests/ImageCacheTests.swift

+ 1 - 1
Tests/KingfisherTests/ImageCacheTests.swift

@@ -376,7 +376,7 @@ class ImageCacheTests: XCTestCase {
                 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()
             }
         }