If you have errors in your locustfile your test will fail. These could be simple python parse errors, or actual issues with the definition of your test.
Use the Test Debugger
LoadForge has a free test debugger which will try to run your test and attempt to send several requests through it. Head over to the Test Debugger to continue.
You can ensure your script parses by writing it to a file locally, e.g. example.py and parsing it:
python -m py_compile example.py
Run a local locust test
You can also install locust as shown and then test file locally, in our example it's
sudo apt-get -y install python3-pip libxml2-dev libxslt1-dev python-dev sudo pip3 install locust==2.8.6 pyquery uuid gevent websocket Flask \ gevent-websocket greenlet itsdangerous Jinja2 linecache2 MarkupSafe \ mock msgpack pyzmq==22.3.0 requests six traceback2 unittest2 \ websocket-client Werkzeug jsonpath-ng PyMySQL sqlalchemy pg8000 \ xmltodict pandas oauthlib locust -f example.py --host https://YOUR_HOST_HERE -u 10 -r 10 \ --run-time 1m --headless
This will run a short 1-minute test with 10 sample users. You'll be able to see any errors and debug your test file.
You may also email us at firstname.lastname@example.org at any time should you need assistance with your locustfile. Or you could live chat us! The point is, get in touch, and we will be happy to help you!