lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment
MIT License
5.83k stars 431 forks source link

LambdaContext giving negative time remaining #281

Closed AdamLewisGMSL closed 4 years ago

AdamLewisGMSL commented 4 years ago

When running a lambda with DOCKER_LAMBDA_STAY_OPEN, each time you invoke the lambda the RemainingTime property decreases as it appears to base the StartTime from the moment you started hosting the lambda, not from the moment you started the execution. Keep it going long enough and you get a negative RemainingTime result.

Suspect this is to do with MockLambdaContext.cs

mhart commented 4 years ago

Which runtime is this for?

AdamLewisGMSL commented 4 years ago

.NET 2.1

mhart commented 4 years ago

Gotcha – will look into it, thanks

mhart commented 4 years ago

Fixed in https://github.com/lambci/docker-lambda/commit/5ca3009aebfe1fe05e5c5aebec4a96b4648beb08