edamame-load-test / edamame

A distributed load testing framework for real-time collaboration apps (HTTP and WebSockets)
5 stars 1 forks source link

update runTest to prevent user from running more than 1 test at a time #115

Closed westrachel closed 1 year ago

westrachel commented 1 year ago

After the initial checks that a user specified an appropriate load test file and a unique test name in runTest.js, added a check to see if a testIsRunning.txt file exists. This solution is using a local file's existence as a way to flag that a test is running, because otherwise could run into network latency issues when trying to assess if a load test is running that would allow a user to sneak through and problematically run 2 tests at once.

Specifically, if don't flag locally that a test is running, then would have to query the dbApi to see if a test currently has a 'started' or 'running' status. The testIsRunning.txt file is generated after all the initial checks in runTest.js are conducted and is deleted after the test runs to completion.

Considered updating the already existing .env file to flag that a test is running locally, but decided creating a small text file was simpler, because the existing .env file is used to store configuration and application information. When running a test, we just need a quick way to check that the runTest's execution process has already begun, which can be flagged with the presence of a file and doesn't require storing specific info in the .env file.

westrachel commented 1 year ago

https://github.com/edamame-load-test/edamame/assets/76174119/d58d96f1-a4c5-42d4-ae70-5ce8597e1af6