question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS Lambda Mock Context Failing Tests

See original GitHub issue

It seems like this is causing some errors occasionally that cause tests to fail.

Error: Task timed out after 3.00 seconds
  null._onTimeout (node_modules/aws-lambda-mock-context/index.js:68:17)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
southpolestevecommented, Jun 7, 2017

Is this all due to the lib we are using? If so we should just bail on it and make our own. We should throw and error on using those old methods.

On Jun 7, 2017 10:29 AM, “Chris Olszewski” notifications@github.com wrote:

I think issues are being caused since we don’t cxt.succeed() the timeout triggers so even when a function run is successful if the process is still running 3 seconds later, context will throw a timeout error.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bustle/shep/issues/240#issuecomment-306812269, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcxaGyxvAR0m4t1lphl2PyB0POrq5jfks5sBrOxgaJpZM4NrwSw .

0reactions
chris-olszewskicommented, Jun 7, 2017

I think issues are being caused since we don’t cxt.succeed() the timeout triggers so even when a function run is successful if the process is still running 3 seconds later, context will throw a timeout error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-lambda-mock-context - npm
AWS Lambda mock context object. Latest version: 3.2.1, last published: 4 years ago. Start using aws-lambda-mock-context in your project by ...
Read more >
Mock Lambda callback in Jest? (Cannot read property body of ...
The expectation needs to move into the callback. The test will fail with a timeout if done() is not called. The expectation needs...
Read more >
Testing AWS Lambda functions written in Java
Testing is an essential task when building software. Testing helps improve software quality by finding bugs before they reach production.
Read more >
Unit testing on Lambda - Medium
very little code so no need to test, difficulties to mock AWS services or to simulate Lambda), but none of them should lead...
Read more >
How I Write Meaningful Tests for AWS Lambda Functions
To get around this problem, one approach is to set up and later tear down separate test resources. A cleaner approach though, is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found