You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of our Lambda integration tests have function handlers that return a Stream rather than the usual response object. (see ApplicationLoadBalancerRequestHandlerReturnsStream and other methods in LambdaSelfExecutingAssembly\Program.cs).
The integration tests pass as expected, but the lambda test tool fixture generates some errors that suggest that we might be doing something wrong in how we're returning the stream response.
2024-06-06T20:01:01.231Z 000000000001 fail Amazon.Lambda.Serialization.SystemTextJson.JsonSerializerException: Error converting the response object of type System.IO.Stream from the Lambda function to JSON: Timeouts are not supported on this stream.
---> System.InvalidOperationException: Timeouts are not supported on this stream.
at System.IO.Stream.get_ReadTimeout()
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Serialize(Utf8JsonWriter writer, T& rootValue, Object rootValueBoxed)
at System.Text.Json.JsonSerializer.Serialize[TValue](Utf8JsonWriter writer, TValue value, JsonSerializerOptions options)
at Amazon.Lambda.Serialization.SystemTextJson.AbstractLambdaJsonSerializer.Serialize[T](T response, Stream responseStream)
--- End of inner exception stack trace ---
at Amazon.Lambda.Serialization.SystemTextJson.AbstractLambdaJsonSerializer.Serialize[T](T response, Stream responseStream)
at Amazon.Lambda.RuntimeSupport.HandlerWrapper.<>c__DisplayClass44_0`2.<GetHandlerWrapper>b__0(InvocationRequest invocation)
at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InvokeOnceAsync(CancellationToken cancellationToken)
We should investigate whether our implementation that returns a Stream is the correct way to do it in Lambda land.
The text was updated successfully, but these errors were encountered:
The main purpose of this test scenario is to trigger a case that forces our instrumentation to make no assumptions about the return type used for these web request lambdas. The Stream type was chosen arbitrarily for these tests.
Some of our Lambda integration tests have function handlers that return a
Stream
rather than the usual response object. (seeApplicationLoadBalancerRequestHandlerReturnsStream
and other methods inLambdaSelfExecutingAssembly\Program.cs
).The integration tests pass as expected, but the lambda test tool fixture generates some errors that suggest that we might be doing something wrong in how we're returning the stream response.
We should investigate whether our implementation that returns a
Stream
is the correct way to do it in Lambda land.The text was updated successfully, but these errors were encountered: