Mimic lambda lifecycle in Lambda Test Tool #1247
Labels
feature-request
A feature should be added or improved.
module/lambda-test-tool
p3
This is a minor priority issue
queued
Describe the feature
Currently, the Lambda Test Tool re-creates instances of a lambda every time the lambda function is invoked. I would expect that a lambda would be instantiated once and re-used for some configurable amount of time, similar to how it is hosted in AWS (FunctionInit).
In the following code sample, if I use the Lambda Test Tool to execute the function twice in quick succession, I would expect the results to look like:
and for more consecutive executions to continue to increment the first number. Instead, the actual results look like:
Example:
Use Case
For testing lifetime management of objects in lambas, I need to be able to have the lambda last longer than a single execution in the test environment. This would mimic the lifecycle of a lambda in AWS.
Proposed Solution
A configuration entry in the configuration file (
aws-lambda-tools-defaults.json
) to configure the lifetime of a lambda.or if managing the life-cycle is too difficult, even just a setting to persist the lambda for the lifetime of the test tool.
If this is already a feature, some documentation about the lifetime of a lambda in the test tool and how it differs from the lifetime in AWS (if at all) would be great.
Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
dotnet tools:
amazon.lambda.testtool-6.0 0.12.3
NuGet packages
Amazon.Lambda.Core 2.1.0
Amazon.Lambda.Serialization.SystemTextJson 2.3.0
Targeted .NET Platform
.NET 6
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: