bustle / shep

A framework for building JavaScript Applications with AWS API Gateway and Lambda
MIT License
378 stars 27 forks source link

AWS Lambda Mock Context Failing Tests #240

Closed chris-olszewski closed 7 years ago

chris-olszewski commented 7 years ago

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)
chris-olszewski commented 7 years ago

Seems to happen when tests are being run with -w flag

reconbot commented 7 years ago

If it does weird global stuff it might need something to wrap it or a PR upstream

On Wed, May 31, 2017, 11:58 AM Chris Olszewski notifications@github.com wrote:

Seems to happen when tests are being run with -w flag

— 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-305233228, or mute the thread https://github.com/notifications/unsubscribe-auth/AABlblhEea_Ritcndtqw8gdC4IY7ptusks5r_Y4LgaJpZM4NrwSw .

chris-olszewski commented 7 years ago

Trying to fully utilize the context, but not sure it's right for us. Looks like it expects all lambda functions not to use the callback, but instead context.succeed() or context.fail()

reconbot commented 7 years ago

That's the really old style of lambda

On Wed, Jun 7, 2017 at 9:58 AM, Chris Olszewski notifications@github.com wrote:

Trying to fully utilize the context, but not sure it's right for us. Looks like it expects all lambda functions not to use the callback, but instead context.succeed() or context.fail()

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

-- Francis Gulotta Director of Engineering Bustle.com / @bustlelabs

chris-olszewski commented 7 years ago

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.

southpolesteve commented 7 years ago

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 .