Skip to content
Load Testing for MilMove
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
apps
.editorconfig
.flake8
.gitignore
.markdownlintrc
.pre-commit-config.yaml
LICENSE.md
Makefile
README.md
demo.py
locustfile.py
requirements-dev.txt
requirements.txt

README.md

Load Testing

Load testing for the MilMove application is done with the code in this repo. Testing employs the locust.io framework which in turn uses the Bravado swagger library to make requests.

Creating devlocal users for load testing

Load testing will require that you create a number of different users for your scenarios. To create a devlocal user you'll hit the /devlocal-auth/create endpoint. The /create method is different from /new because it returns a JSON formatted version of the User model for the new user instead of redirecting to the landing page. The new user will be logged in upon creation and the response will contain the session token you'd expect from a normal login.

What is tested

The load testing demo implements these things:

  • Anon User: Touching home page only
  • Service Member App: PPM Flow only
  • Office App: Queue and Move Inspection (no move modification)

Quick Start

Getting started

make setup

From the MilMove application in a separate window ensure that the app server is running with make server_run_standalone.

Running tests with Web UI

make load_test

Then open http://localhost:8089 and enter the number of users to simulate and the hatch rate. Finally, hit the Start swarming button and wait for the tests to finish.

Running tests from the CLI

You can run the test suite without the Web UI with a command similar to this:

make load_test_noweb

Or you can run this by hand with:

locust -f locustfile.py --no-web --clients=50 --hatch-rate=5 --run-time=60s

Load Testing against AWS Experimental Environment

To load test against the AWS Experimental Environment you must modify the DEVLOCAL_AUTH environment variable and deploy the code to the experimental environment.

Then you can use the same steps as the development as above as long as you change the host parameter in the locustfile.py test classes and point them to the experimental domains:

Handling Rate Limiting

Each environment is set to limit the number of requests from a single IP in a 5 minute period. That limit is usually 2000. For load testing it's likely you'll want a much higher limit, perhaps even 10 times as high. Work with infrastructure to modify the limit. Here is the diff to apply:

diff --git a/transcom-ppp/app-experimental/main.tf b/transcom-ppp/app-experimental/main.tf
index 4ef1a29..bac3cf7 100644
--- a/transcom-ppp/app-experimental/main.tf
+++ b/transcom-ppp/app-experimental/main.tf
@@ -65,6 +65,7 @@ module "app" {

   waf_regex_path_disallow_pattern_strings = []
   waf_regex_host_allow_pattern_strings    = [".move.mil$", ".dp3.us$", "^mymove-experimental.sddc.army.mil$"]
+  waf_ip_rate_limit                       = 20000
   wafregional_rule_id                     = "d0ad0bb7-434b-4112-bde0-b5e84b718733"
 }

Metrics

You will want to see metrics from your runs:

References

You can’t perform that action at this time.