Skip to content

Commit e1bb59f

Browse files
author
Clément Le Provost
committed
Add test case for TCP connection dropping
1 parent 3e1a65e commit e1bb59f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/IndexTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,4 +963,20 @@ class IndexTests: XCTestCase {
963963
})
964964
waitForExpectationsWithTimeout(expectationTimeout, handler: nil)
965965
}
966+
967+
func testTCPDrop() {
968+
let expectation = expectationWithDescription(#function)
969+
970+
// The host `notcp-xx-1.algolianet.com` will drop TCP connections.
971+
client.readHosts[0] = "notcp-xx-1.algolianet.com"
972+
973+
client.listIndexes({
974+
(content, error) -> Void in
975+
if error != nil {
976+
XCTFail(error!.description)
977+
}
978+
expectation.fulfill()
979+
})
980+
waitForExpectationsWithTimeout(expectationTimeout, handler: nil)
981+
}
966982
}

0 commit comments

Comments
 (0)