Skip to content

Commit de53f0f

Browse files
committed
Fixed testAvoidLeakingTLSHandshakeCompletionPromise for TS
Checking for the correct error.
1 parent 8a3da7c commit de53f0f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Tests/AsyncHTTPClientTests/HTTPClientTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,15 @@ class HTTPClientTests: XCTestCase {
16751675
}
16761676

16771677
XCTAssertThrowsError(try httpClient.get(url: "http://localhost:\(port)").wait()) { error in
1678+
#if canImport(Network)
1679+
if #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *), isTestingNIOTS() {
1680+
guard let nwError = error as? NWError, case NWError.posix(let posixErrorCode) = nwError, posixErrorCode == .ECONNREFUSED else {
1681+
XCTFail("Unexpected error: \(error)")
1682+
return
1683+
}
1684+
return
1685+
}
1686+
#endif
16781687
guard error is NIOConnectionError else {
16791688
XCTFail("Unexpected error: \(error)")
16801689
return

0 commit comments

Comments
 (0)