diff --git a/Tests/AsyncHTTPClientTests/HTTPClientTests.swift b/Tests/AsyncHTTPClientTests/HTTPClientTests.swift index eef14a78a..1c976343c 100644 --- a/Tests/AsyncHTTPClientTests/HTTPClientTests.swift +++ b/Tests/AsyncHTTPClientTests/HTTPClientTests.swift @@ -2715,9 +2715,14 @@ class HTTPClientTests: XCTestCase { XCTAssertNoThrow(try server.close().wait()) } - // We set the connect timeout down very low here because on NIOTS this manifests as a connect - // timeout. - let config = HTTPClient.Configuration(timeout: HTTPClient.Configuration.Timeout(connect: .milliseconds(100), read: nil)) + var timeout = HTTPClient.Configuration.Timeout(connect: .seconds(10)) + if isTestingNIOTS() { + // If we are using Network.framework, we set the connect timeout down very low here + // because on NIOTS a failing TLS handshake manifests as a connect timeout. + timeout.connect = .milliseconds(100) + } + + let config = HTTPClient.Configuration(timeout: timeout) let client = HTTPClient(eventLoopGroupProvider: .shared(self.clientGroup), configuration: config) defer { XCTAssertNoThrow(try client.syncShutdown())