Skip to content

Commit 7ba6a96

Browse files
committed
Make testSSLHandshakeErrorPropagationDelayedClose less flaky
1 parent 390a790 commit 7ba6a96

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: Tests/AsyncHTTPClientTests/HTTPClientTests.swift

+8-3
Original file line numberDiff line numberDiff line change
@@ -2761,9 +2761,14 @@ class HTTPClientTests: XCTestCase {
27612761
XCTAssertNoThrow(try server.close().wait())
27622762
}
27632763

2764-
// We set the connect timeout down very low here because on NIOTS this manifests as a connect
2765-
// timeout.
2766-
let config = HTTPClient.Configuration(timeout: HTTPClient.Configuration.Timeout(connect: .milliseconds(200), read: nil))
2764+
var timeout = HTTPClient.Configuration.Timeout(connect: .seconds(10))
2765+
if isTestingNIOTS() {
2766+
// If we are using Network.framework, we set the connect timeout down very low here
2767+
// because on NIOTS a failing TLS handshake manifests as a connect timeout.
2768+
timeout.connect = .milliseconds(300)
2769+
}
2770+
2771+
let config = HTTPClient.Configuration(timeout: timeout)
27672772
let client = HTTPClient(eventLoopGroupProvider: .shared(self.clientGroup), configuration: config)
27682773
defer {
27692774
XCTAssertNoThrow(try client.syncShutdown())

0 commit comments

Comments
 (0)