Skip to content

Commit d500a0c

Browse files
committed
Fixed testAvoidLeakingTLSHandshakeCompletionPromise for TS
Checking for the correct error.
1 parent 014cef3 commit d500a0c

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
@@ -1681,6 +1681,15 @@ class HTTPClientTests: XCTestCase {
16811681
}
16821682

16831683
XCTAssertThrowsError(try httpClient.get(url: "http://localhost:\(port)").wait()) { error in
1684+
#if canImport(Network)
1685+
if #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *), isTestingNIOTS() {
1686+
guard let nwError = error as? NWError, case NWError.posix(let posixErrorCode) = nwError, posixErrorCode == .ECONNREFUSED else {
1687+
XCTFail("Unexpected error: \(error)")
1688+
return
1689+
}
1690+
return
1691+
}
1692+
#endif
16841693
guard error is NIOConnectionError else {
16851694
XCTFail("Unexpected error: \(error)")
16861695
return

0 commit comments

Comments
 (0)