Appendix B: Test Workflow - Distributed Load Testing on AWS

Appendix B: Test Workflow

The following detailed breakdown shows the steps involved to run a test scenario.

      Test workflow

Figure 3: Test workflow

  1. You use the web console to submit a test scenario that includes the configuration details to the solution’s API.

  2. The test scenario configuration is uploaded to the Amazon Simple Storage Service (Amazon S3) as a JSON file (s3://<bucket-name>/test-scenarios/<$TEST_ID>/<$TEST_ID>.json).

  3. The test ID and the task count are stored in Amazon Simple Queue Service (Amazon SQS).

  4. Configuration details are stored in the scenarios Amazon DynamoDB table.

  5. The task-runner AWS Lambda function pulls the task details from Amazon SQS and runs the Amazon Elastic Container Service (Amazon ECS) tasks in the AWS Fargate cluster. The Amazon ECS API uses the RunTask action to run the task. The RunTask action is limited to 10 tasks per definition. If your task count is more than 10, the task definition will run multiple times until all tasks are complete.

  6. Each task downloads the test configuration from Amazon S3 and starts the test.

  7. The average response time for each task is logged in Amazon CloudWatch and can be viewed in a CloudWatch dashboard.

  8. When the test is complete, the container images export a detail report as an XML file to Amazon S3. Each file is given a UUID for the filename. For example, s3://dlte-bucket/test-scenarios/<$TEST_ID>/results/<$UUID>.json.

  9. When the XML file is uploaded to Amazon S3, the results-parser Lambda function is triggered. The function reads the results in the XML file and writes the results to the Amazon DynamoDB table.

  10. The results-parser Lambda function checks the total task count against the completed task count. If all tasks are complete, the results in DynamoDB are aggregated and written to another DynamoDB table.