Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

break 5min lambda barrier #112

Merged
merged 4 commits into from
Apr 24, 2017

Conversation

cwaltken-edrans
Copy link
Collaborator

This pull request resolves #102 the 5 minute execution timeout that is inherent to execution of lambda functions on aws.

The commit introduces a lot of changes to lambda/lambda.go mainly because the code execution paths became increasingly hard to follow. To make changes without introducing breaking changes to the API a small suite of unit tests was added to accompany the refactoring.

This commit also fixes a bug terminating the CLI to early when more then one lambda is running in a region.

Functional changes are:

  • execution timeout of AWS lambda functions no longer stops execution of long running load tests
  • the CLI introduces a limit for total execution of 60 minutes
  • setup infrastructure permissions to spawn new lambda from existing lambda
  • allow execution by time rather than quantity of requirements
  • fix termination check of executing lambdas within CLI
  • add test execution to Makefile
  • update golang version to 1.8

This is the list of individual changes introduced by the refactoring:

  • add tests for fetch function
  • extract methods to prepare and send requests
  • move timestamping closer to request execution
  • create a struct holding the state of lambda execution
  • simplify method calls
  • break down runLoadTest method to simplify cascading for loops
  • simplify spawn logic for request worker go routines
  • extract lambdaSettings as struct
  • move code for the lambdas initial state into setup methods
  • setup some default values for lambda
  • create various tests for runLoadTest
  • extract method to parse lambda settings
  • simplify requestParameters
  • extract calculation of intermediary results to separate structs
  • introduce request metric struct to reduce complexity of result calculaton
  • add timeout tests
  • introduce interface for SQSAdapter to mock during testing
  • use elapsed to calculade lastRequestTime for more precise results
  • add tests for quitting on lambda timeout
  • assert last result is sent on timeout
  • apply rename refactoring to functions and variables
  • allow to fork into new AWS Lambda on AWS timeout
  • fix test codesmells
  • fix TotBytes read with new aggregation function
  • use aws.lambda via interface to improve testing
  • fix request count transmitted to the cli
  • set the AWS_TIMEOUT back to almost 5 minutes

 * add tests for fetch function
 * extract methods to prepare and send requests
 * move timestamping closer to request execution
 * create a struct holding the state of lambda execution
 * simplify method calls
 * break down runLoadTest method to simplify cascading for loops
 * simplify spawn logic for request worker go routines
 * extract lambdaSettings as struct
 * move code for the lambdas initial state into setup methods
 * setup some default values for lambda
 * create various tests for runLoadTest
 * extract method to parse lambda settings
 * simplify requestParameters
 * extract calculation of intermediary results to separate structs
 * introduce request metric struct to reduce complexity of result calculaton
 * add timeout tests
 * introduce interface for SQSAdapter to mock during testing
 * use elapsed to calculade lastRequestTime for more precise results
 * add tests for quitting on lambda timeout
 * assert last result is sent on timeout
 * apply rename refactoring to functions and variables
 * allow to fork into new AWS Lambda on AWS timeout
 * fix test codesmells
 * fix TotBytes read with new aggregation function
 * use aws.lambda via interface to improve testing
 * fix request count transmitted to the cli
 * set the AWS_TIMEOUT back to almost 5 minutes
 * add missing region in SQS data
 * allow execution by time rather than quantity of requirements
 * add test for stresstestTimeout
 * fix remainingRequestCount negative termination check
 * add test execution to Makefile
 * update golang versions to 1.8 in Dockerfile and Godeps
@zeph zeph merged commit 2099508 into goadapp:master Apr 24, 2017
@cwaltken-edrans cwaltken-edrans deleted the 102-break-5min-lambda-barrier branch April 28, 2017 13:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

break 5min lambda barrier
2 participants