Travelokapay Load Test Participation Guide

Giving a little background on how we're going to proceed with travelokapay load test today, we're aiming to do load tests using a number of different users with several different scenarios. The scenarios included are:

Some context you need to know before testing:

The effect it has on our test:
We're doing load test only on travelokapay system, therefore to remove dependency from Traveloka and to reduce the risks it might imply on Traveloka side, we're going to inject access token manually instead of making it part of automatic test. And since access token has time to live (it can expire), injecting access token will be done before each test to make sure we always use fresh access token.

How to:

Initialize travelokapay load test:

Inject access token:

Get tvLifetime and tvSession

Get access token from Traveloka

POST /en-id/v2/user/idp/authorizeContext HTTP/1.1
Host: api-shared-stg.test.tvlk.cloud
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: ee32cb9c-b268-faea-db28-3f0f3b4dc834

{
"data": {
"scope": "access_level_partial",
"clientId": "d2b93823848c50b70623dd8430b7a688"
},
"fields": [],
"context": {
"nonce":"f1b18234-af08-11e7-abc4-cec278b6b50a", // you can use https://www.uuidgenerator.net/ to generate random UUID
"tvLifetime":"[your_tv_lifetime]",
"tvSession":"[your_tv_session]
},
"clientInterface": "web"
}

Copy idToken value from no 2 response and set it as environment variable ACCESS_TOKEN

export ACCESS_TOKEN='[id_token]'

Increase open file limit

Please follow this guide on how to increase per-user limit https://easyengine.io/tutorials/linux/increase-open-files-limit/
Notes: you should only need to follow steps to edit /etc/security/limits.conf and to relogin after that
And to check if your limit has been updated:

Check Hard Limit in Linux
# ulimit -Hn
Check Soft Limit in Linux
# ulimit -Sn

Run locust as slave:

locust -f [file_path]/default-load-test.py --host=https://api-tpaypapi.stg.tvlk-pay.com --slave --master-host=10.10.45.23

for example, if you're currently on [your_path]/travelokapay-test/locust-file directory, you can just run

locust -f default-load-test.py --host=https://api-tpaypapi.stg.tvlk-pay.com --slave --master-host=10.10.45.23

More info about running locust: https://docs.locust.io/en/latest/quickstart.html