3
我在調查Alamofire
如何執行NSOperation
的單元測試。這是其他測試使用的基本測試類。任何想法爲什麼它使用30
秒爲timeout
期望?爲什麼Alamofire對單元測試的超時期望值使用30秒?
import Alamofire
import Foundation
import XCTest
class BaseTestCase: XCTestCase {
let timeout: NSTimeInterval = 30.0
func URLForResource(fileName: String, withExtension: String) -> NSURL {
let bundle = NSBundle(forClass: BaseTestCase.self)
return bundle.URLForResource(fileName, withExtension: withExtension)!
}
}
感謝您的回覆。我問這個問題,因爲我試圖在Circle CI中單元測試一個自定義的'NSOperation',但是我有一個超時問題。 –
Gotcha。我首先會提高暫停時間,看看你會得到什麼。 – cnoon
謝謝。因此,問題可能是由於Circle CI中的資源較少(與本地相比)。 –