From 7fbec1d712db0633c6fb12ec27908315fdc7564b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Stormacq?= Date: Mon, 1 Sep 2025 12:47:14 +0200 Subject: [PATCH 1/2] rename test function `timeout` to `withTimeout` --- Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTests.swift | 2 +- Tests/AWSLambdaRuntimeTests/Timeout.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTests.swift b/Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTests.swift index fe85f973..f10026f9 100644 --- a/Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTests.swift +++ b/Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTests.swift @@ -299,7 +299,7 @@ struct LambdaRuntimeClientTests { // simulate traffic until the server reports it has closed the connection // or a timeout, whichever comes first // result is ignored here, either there is a connection error or a timeout - let _ = try await timeout(deadline: .seconds(1)) { + let _ = try await withTimeout(deadline: .seconds(1)) { while true { let (_, writer) = try await runtimeClient.nextInvocation() try await writer.writeAndFinish(ByteBuffer(string: "hello")) diff --git a/Tests/AWSLambdaRuntimeTests/Timeout.swift b/Tests/AWSLambdaRuntimeTests/Timeout.swift index 6a8dc5dc..934325cd 100644 --- a/Tests/AWSLambdaRuntimeTests/Timeout.swift +++ b/Tests/AWSLambdaRuntimeTests/Timeout.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// // as suggested by https://github.com/vapor/postgres-nio/issues/489#issuecomment-2186509773 -func timeout( +func withTimeout( deadline: Duration, _ closure: @escaping @Sendable () async throws -> Success ) async throws -> Success { From 2c638f2103d00e4f35ab8d2fe402d66413488aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Stormacq?= Date: Mon, 1 Sep 2025 12:50:47 +0200 Subject: [PATCH 2/2] fix typo --- Sources/AWSLambdaRuntime/LambdaRuntimeClient.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AWSLambdaRuntime/LambdaRuntimeClient.swift b/Sources/AWSLambdaRuntime/LambdaRuntimeClient.swift index 1d90e2c9..a80eba9c 100644 --- a/Sources/AWSLambdaRuntime/LambdaRuntimeClient.swift +++ b/Sources/AWSLambdaRuntime/LambdaRuntimeClient.swift @@ -514,7 +514,7 @@ private final class LambdaChannelHandler "user-agent": .userAgent, "Lambda-Runtime-Function-Response-Mode": "streaming", // these are not used by this runtime client at the moment - // FIXME: the eror handling should inject these headers in the streamed response to report mid-stream errors + // FIXME: the error handling should inject these headers in the streamed response to report mid-stream errors "Trailer": "Lambda-Runtime-Function-Error-Type, Lambda-Runtime-Function-Error-Body", ] }