diff --git a/Source/AwsCommonRuntimeKit/http/HTTP2StreamManager.swift b/Source/AwsCommonRuntimeKit/http/HTTP2StreamManager.swift index 34d4e3e8..903e5b81 100644 --- a/Source/AwsCommonRuntimeKit/http/HTTP2StreamManager.swift +++ b/Source/AwsCommonRuntimeKit/http/HTTP2StreamManager.swift @@ -3,7 +3,7 @@ import AwsCHttp /// Manages a Pool of HTTP/2 Streams. Creates and manages HTTP/2 connections under the hood. -public class HTTP2StreamManager { +public class HTTP2StreamManager: @unchecked Sendable { let rawValue: UnsafeMutablePointer public init(options: HTTP2StreamManagerOptions) throws { diff --git a/Test/AwsCommonRuntimeKitTests/http/HTTPClientTestFixture.swift b/Test/AwsCommonRuntimeKitTests/http/HTTPClientTestFixture.swift index 63f7e591..34949dbb 100644 --- a/Test/AwsCommonRuntimeKitTests/http/HTTPClientTestFixture.swift +++ b/Test/AwsCommonRuntimeKitTests/http/HTTPClientTestFixture.swift @@ -34,35 +34,34 @@ class HTTPClientTestFixture: XCBaseTestCase { var httpResponse = HTTPResponse() await withCheckedContinuation { (continuation: CheckedContinuation) in - Task { - let httpRequestOptions: HTTPRequestOption + let httpRequestOptions: HTTPRequestOptions if requestVersion == HTTPVersion.version_2 { httpRequestOptions = try getHTTP2RequestOptions( - method: method, - path: path, - authority: endpoint, - body: body, - response: &httpResponse, - continuation: continuation, - onResponse: onResponse, - onBody: onBody, - onComplete: onComplete) + method: method, + path: path, + authority: endpoint, + body: body, + response: &httpResponse, + continuation: continuation, + onResponse: onResponse, + onBody: onBody, + onComplete: onComplete) } else { httpRequestOptions = try getHTTPRequestOptions( - method: method, - endpoint: endpoint, - path: path, - body: body, - response: &httpResponse, - continuation: continuation, - onResponse: onResponse, - onBody: onBody, - onComplete: onComplete) + method: method, + endpoint: endpoint, + path: path, + body: body, + response: &httpResponse, + continuation: continuation, + onResponse: onResponse, + onBody: onBody, + onComplete: onComplete) } - + for i in 1...numRetries+1 where httpResponse.statusCode != expectedStatus { print("Attempt#\(i) to send an HTTP request") - let connection = try await connectionManager.acquireConnection() + XCTAssertTrue(connection.isOpen) httpResponse.version = connection.httpVersion XCTAssertEqual(connection.httpVersion, expectedVersion) @@ -98,7 +97,7 @@ class HTTPClientTestFixture: XCBaseTestCase { authority: authority, body: body, response: &httpResponse, - continutaion: continuation, + continuation: continuation, onResponse: onResponse, onBody: onBody, onComplete: onComplete, @@ -145,7 +144,7 @@ class HTTPClientTestFixture: XCBaseTestCase { func getRequestOptions(request: HTTPRequestBase, response: UnsafeMutablePointer? = nil, - continutaion: CheckedContinuation? = nil, + continuation: CheckedContinuation? = nil, onResponse: HTTPRequestOptions.OnResponse? = nil, onBody: HTTPRequestOptions.OnIncomingBody? = nil, onComplete: HTTPRequestOptions.OnStreamComplete? = nil, @@ -169,7 +168,7 @@ class HTTPClientTestFixture: XCBaseTestCase { response?.pointee.error = error } onComplete?(result) - continutaion?.resume() + continuation?.resume() }, http2ManualDataWrites: http2ManualDataWrites) } @@ -180,7 +179,7 @@ class HTTPClientTestFixture: XCBaseTestCase { path: String, body: String = "", response: UnsafeMutablePointer? = nil, - continutaion: CheckedContinuation? = nil, + continuation: CheckedContinuation? = nil, headers: [HTTPHeader] = [HTTPHeader](), onResponse: HTTPRequestOptions.OnResponse? = nil, onBody: HTTPRequestOptions.OnIncomingBody? = nil, @@ -199,7 +198,7 @@ class HTTPClientTestFixture: XCBaseTestCase { return getRequestOptions( request: httpRequest, response: response, - continutaion: continutaion, + continuation: continuation, onResponse: onResponse, onBody: onBody, onComplete: onComplete) @@ -212,7 +211,7 @@ class HTTPClientTestFixture: XCBaseTestCase { body: String = "", manualDataWrites: Bool = false, response: UnsafeMutablePointer? = nil, - continutaion: CheckedContinuation? = nil, + continuation: CheckedContinuation? = nil, onResponse: HTTPRequestOptions.OnResponse? = nil, onBody: HTTPRequestOptions.OnIncomingBody? = nil, onComplete: HTTPRequestOptions.OnStreamComplete? = nil, @@ -228,7 +227,7 @@ class HTTPClientTestFixture: XCBaseTestCase { return getRequestOptions( request: http2Request, response: response, - continutaion: continutaion, + continuation: continuation, onResponse: onResponse, onBody: onBody, onComplete: onComplete,