From 1f30cec0df7d82237f8b7bdb325ef47a87130f7c Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Fri, 24 Jan 2025 15:53:50 -0500 Subject: [PATCH 1/3] try making client reusable --- .github/workflows/integration-test.yml | 1 + .../TranscribeStreamingTests.swift | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index ec7ce42a0df..1a160ead11c 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -148,6 +148,7 @@ jobs: version: - "5.9" - "6.0" + iteration: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: diff --git a/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift b/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift index d9529344cb2..49e5060d4bf 100644 --- a/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift +++ b/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift @@ -13,6 +13,14 @@ import protocol AWSClientRuntime.AWSServiceError final class TranscribeStreamingTests: XCTestCase { + // Shared TranscribeStreamingClient instance + private var client: TranscribeStreamingClient! + + override func setUp() async throws { + try await super.setUp() + client = try TranscribeStreamingClient(region: "us-west-2") + } + // MARK: - Test transcription func test_single_streamTranscription() async throws { @@ -52,8 +60,6 @@ final class TranscribeStreamingTests: XCTestCase { let dataRate = Double(audioDataSize) / duration let delay = Double(chunkSize) / dataRate - let client = try TranscribeStreamingClient(region: "us-west-2") - let audioStream = AsyncThrowingStream { continuation in Task { var currentStart = 0 From 72e06a336600dc9dce0e9b028ba8c328ed4c2c06 Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Fri, 24 Jan 2025 16:13:02 -0500 Subject: [PATCH 2/3] re-enable test on linux --- .../TranscribeStreamingTests.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift b/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift index 49e5060d4bf..76fe9e691dc 100644 --- a/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift +++ b/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift @@ -27,8 +27,6 @@ final class TranscribeStreamingTests: XCTestCase { try await attempt() } -#if !os(Linux) - // Concurrent stream transcription frequently fails on the CRT HTTP client with errors // such as: // code: 2087, message: "Stream acquisition failed because stream manager failed to acquire a connection" @@ -40,8 +38,6 @@ final class TranscribeStreamingTests: XCTestCase { try await repeatConcurrently(count: 25, test: attempt) } -#endif - // MARK: - Private / implementation methods private func performStreamTranscription() async throws { From 887bb6d9b2710d884542621544ca79a33778353c Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Mon, 27 Jan 2025 10:08:22 -0500 Subject: [PATCH 3/3] retry 2077 instead of 2087 --- .../AWSClientRuntime/Retry/AWSRetryErrorInfoProvider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Retry/AWSRetryErrorInfoProvider.swift b/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Retry/AWSRetryErrorInfoProvider.swift index 6233b76e683..ce00b49de28 100644 --- a/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Retry/AWSRetryErrorInfoProvider.swift +++ b/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Retry/AWSRetryErrorInfoProvider.swift @@ -45,7 +45,7 @@ public enum AWSRetryErrorInfoProvider: RetryErrorInfoProvider { private static let transientCRTErrorCodes: [Int32] = [ 2058, // httpConnectionClosed 2070, // httpServerClosed - 2087, // AWS_ERROR_HTTP_STREAM_MANAGER_CONNECTION_ACQUIRE_FAILURE + 2077, // AWS_ERROR_HTTP_RST_STREAM_RECEIVED ] // HTTP status codes that the Retry Behavior 2.0 specification say should be treated as transient errors.