Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LambdaTestTool - Support for Sync Invoke Waiting #1639

Open
1 of 2 tasks
huntharo opened this issue Dec 12, 2023 · 1 comment
Open
1 of 2 tasks

LambdaTestTool - Support for Sync Invoke Waiting #1639

huntharo opened this issue Dec 12, 2023 · 1 comment
Labels
feature-request A feature should be added or improved. module/lambda-test-tool p2 This is a standard priority issue queued s Effort estimation: small

Comments

@huntharo
Copy link

Describe the feature

Make LambdaClient.InvokeAsync calls work locally.

I have written a version of this but I need some guidance on how to fit this into the overall design here and to make sure I'm not breaking an intentionally existing feature.

Use Case

Complex applications that mix LambdaClient.InvokeAsync with local actions cannot currently be tested locally with both the client application and the lambda itself attached to a debugger. There are some ways around this using a deployed proxy Lambda, but that entire approach is orthogonal to LambdaTestTool's existence.

LambdaClient.InvokeAsync should be able to test blocking / sync invocations of Lambda functions, locally.

For complex projects this is an essential part of development, debugging, and testing.

Proposed Solution

  • The test event endpoint used by the web ui is also annotated with almost the right path to allow InvokeAsync calls from clients to work
  • Add a new endpoint with annotation: [HttpPost("/2015-03-31/functions/{functionName}/invocations")]
    • Wait for a TaskCompletionSource to indicate that the response is ready
    • Relay the response or error back to the caller
  • Related, particularly if debugging or testing invokes that last longer than 1 minute:
    • Allow configurability of the request timeouts

Other Information

I'll submit a draft PR with my implementation that I've been using locally.

I'm looking for feedback on:

  • Is the existing hard-coded function route usable?
    • Is it used for async invokes only?
    • If it is used, I suppose the new route would need to detect that the invoke type is not sync and operate as the current route does
  • Guidance on usage of Action for completion callbacks
    • It does not seem there is much/any usage of Action in the tool
    • Is there an alternative preferred mechanism to use?

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS .NET SDK and/or Package version used

Built from source master branch

Targeted .NET Platform

.NET 8

Operating System and version

Mac OS X Sonoma

@huntharo huntharo added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 12, 2023
@ashishdhingra ashishdhingra added module/lambda-test-tool needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Dec 12, 2023
@ashishdhingra
Copy link
Contributor

Needs review with the team.

@ashishdhingra ashishdhingra added p2 This is a standard priority issue s Effort estimation: small queued and removed needs-review labels Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/lambda-test-tool p2 This is a standard priority issue queued s Effort estimation: small
Projects
None yet
Development

No branches or pull requests

2 participants