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

Fix AWS Lambda tests #2795

Open
sentrivana opened this issue Mar 7, 2024 · 0 comments · May be fixed by #3988
Open

Fix AWS Lambda tests #2795

sentrivana opened this issue Mar 7, 2024 · 0 comments · May be fixed by #3988
Labels
Integration: AWS Lambda Integration: Serverless Triaged Has been looked at recently during old issue triage

Comments

@sentrivana
Copy link
Contributor

sentrivana commented Mar 7, 2024

We rely on the log output of our AWS Lambda tests to determine whether the tests have been successful: we log envelope and event contents and then check whether the log output looks as expected.

AWS Lambda has recently started logging a new warning when a function throws an unhandled exception. This is a scenario we're testing in some of our test cases.

The problem is that the log output is limited to the last 4kB and the new warning takes up a lot of space, so some of our events/envelopes will not fit anymore.

Some notes:

  • the limit of 4kB cannot be changed
  • the log level cannot be changed for the text loggers that we're using
  • we're already stripping away a lot of the event contents to not run out of space
  • we could consider splitting the failing tests up so that one test doesn't expect too many events
  • the logs also end up in cloudwatch eventually so we could consider polling this, but it takes 5-10 minutes for them to show up there
  • it should somehow be possible to set up a local AWS Lambda environment, then we wouldn't need to set up hacky ways to figure out what the SDK is doing (see e.g. https://github.com/aws/aws-sam-cli)
  • do not use the logs to return captured events but actually send the events to some mock relay or something and check for the events in there (no clue now and where to run this server so the test in GH actions gets the data from the actual Lambda)

For now, we're xfailing the broken tests to get unblocked, but this needs a proper solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration: AWS Lambda Integration: Serverless Triaged Has been looked at recently during old issue triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants