From 2e99dbf39429a3af649b3bacd31b39ba9c73f9ee Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Mon, 25 Sep 2023 17:47:02 -0400 Subject: [PATCH 1/7] add ability to configure timeout in AWSClientConfiguration --- Package.swift | 2 +- .../AWSClientConfiguration.swift | 27 ++++++++++++++----- .../AWSClientConfigurationTests.swift | 9 +++++++ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index f9f5e768b40..51b8921d4bd 100644 --- a/Package.swift +++ b/Package.swift @@ -68,7 +68,7 @@ func addClientRuntimeDependency(_ version: Version) { ] case (false, true): package.dependencies += [ - .package(url: smithySwiftURL, .branch("main")) + .package(url: smithySwiftURL, .branch("day/expose-timeout")) ] case (false, false): package.dependencies += [ diff --git a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift index d92d6964f0a..aedeb005d5e 100644 --- a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift +++ b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift @@ -102,6 +102,11 @@ public class AWSClientConfiguration @@ -128,8 +134,13 @@ public class AWSClientConfiguration Date: Mon, 25 Sep 2023 17:59:39 -0400 Subject: [PATCH 2/7] configure smithy-swift branch for testing --- Package.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 51b8921d4bd..6e0a6d5e995 100644 --- a/Package.swift +++ b/Package.swift @@ -68,11 +68,11 @@ func addClientRuntimeDependency(_ version: Version) { ] case (false, true): package.dependencies += [ - .package(url: smithySwiftURL, .branch("day/expose-timeout")) + .package(url: smithySwiftURL, .branch("main")) ] case (false, false): package.dependencies += [ - .package(url: smithySwiftURL, .exact(version)) + .package(url: smithySwiftURL, .branch("day/expose-timeout")) ] } } From b8d4c57e50953a816dce0ba9bec94cdff5f8ae67 Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Mon, 25 Sep 2023 18:31:12 -0400 Subject: [PATCH 3/7] revert package.swift change --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 6e0a6d5e995..f9f5e768b40 100644 --- a/Package.swift +++ b/Package.swift @@ -72,7 +72,7 @@ func addClientRuntimeDependency(_ version: Version) { ] case (false, false): package.dependencies += [ - .package(url: smithySwiftURL, .branch("day/expose-timeout")) + .package(url: smithySwiftURL, .exact(version)) ] } } From 9c58361870dcee072bc840cf97d1de3bb6ea010c Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Mon, 25 Sep 2023 18:58:59 -0400 Subject: [PATCH 4/7] update type of customTimeout in test --- .../AWSClientRuntimeTests/AWSClientConfigurationTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift b/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift index 0adf15530a5..a630bb12d16 100644 --- a/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift +++ b/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift @@ -67,7 +67,7 @@ class AWSClientConfigurationTests: XCTestCase { // MARK: - Timeout func test_async_configureTimeoutOptionsFromParams() throws { - let customTimeout = 10_000 + let customTimeout: UInt32 = 10_000 let subject = try Subject(region: region, connectTimeoutMs: customTimeout) XCTAssertEqual(subject.connectTimeoutMs, customTimeout) } From 7806078f0fc2c9f4941f118fedc12fa525395837 Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Tue, 26 Sep 2023 10:16:35 -0400 Subject: [PATCH 5/7] fix typo --- Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift index aedeb005d5e..5454e8661b4 100644 --- a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift +++ b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift @@ -104,7 +104,7 @@ public class AWSClientConfiguration Date: Tue, 26 Sep 2023 15:02:22 -0400 Subject: [PATCH 6/7] fix nit and add test for default values --- .../AWSClientRuntime/AWSClientConfiguration.swift | 2 +- .../AWSClientConfigurationTests.swift | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift index 5454e8661b4..2ec22d16b17 100644 --- a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift +++ b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift @@ -104,7 +104,7 @@ public class AWSClientConfiguration Date: Tue, 26 Sep 2023 16:18:31 -0400 Subject: [PATCH 7/7] remove default test, info is not available outside of CRT --- .../AWSClientConfigurationTests.swift | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift b/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift index bea1b7653be..1a6769ab5fb 100644 --- a/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift +++ b/Tests/Core/AWSClientRuntimeTests/AWSClientConfigurationTests.swift @@ -66,18 +66,6 @@ class AWSClientConfigurationTests: XCTestCase { // MARK: - Timeout - func test_sync_defaultTimeout() throws { - let subject = try Subject(region: region) - -#if os(iOS) || os(watchOS) - // default in smithy-swift Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift#L57 - XCTAssertEqual(subject.connectTimeoutMs, 30_000) -#else - // default in SocketOptions class - XCTAssertEqual(subject.connectTimeoutMs, 3_000) -#endif - } - func test_sync_configureTimeoutOptionsFromParams() throws { let customTimeout: UInt32 = 10_000 let subject = try Subject(region: region, connectTimeoutMs: customTimeout)