Skip to content

Commit 4d0915b

Browse files
committed
Fixed testAvoidLeakingTLSHandshakeCompletionPromise for TS
Checking for the correct error.
1 parent 8930193 commit 4d0915b

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
@@ -1669,6 +1669,15 @@ class HTTPClientTests: XCTestCase {
16691669
}
16701670

16711671
XCTAssertThrowsError(try httpClient.get(url: "http://localhost:\(port)").wait()) { error in
1672+
#if canImport(Network)
1673+
if #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *), isTestingNIOTS() {
1674+
guard let nwError = error as? NWError, case NWError.posix(let posixErrorCode) = nwError, posixErrorCode == .ECONNREFUSED else {
1675+
XCTFail("Unexpected error: \(error)")
1676+
return
1677+
}
1678+
return
1679+
}
1680+
#endif
16721681
guard error is NIOConnectionError else {
16731682
XCTFail("Unexpected error: \(error)")
16741683
return

0 commit comments

Comments
 (0)