File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -914,4 +914,21 @@ class IndexTests: XCTestCase {
914914 } )
915915 waitForExpectationsWithTimeout ( expectationTimeout, handler: nil )
916916 }
917+
918+ func testDNSTimeout( ) {
919+ let expectation = expectationWithDescription ( #function)
920+
921+ // The DNS lookup for any host in the `algolia.biz` domain will time-out.
922+ // We generate a new host name every time to avoid any cache effect.
923+ client. readHosts [ 0 ] = " swift- \( UInt32 ( NSDate ( ) . timeIntervalSince1970) ) .algolia.biz "
924+
925+ client. listIndexes ( {
926+ ( content, error) -> Void in
927+ if error != nil {
928+ XCTFail ( error!. description)
929+ }
930+ expectation. fulfill ( )
931+ } )
932+ waitForExpectationsWithTimeout ( expectationTimeout, handler: nil )
933+ }
917934}
You can’t perform that action at this time.
0 commit comments