Debugging Scripts
How to debug a failing LoadForge test.
Debugging Load Tests
If your LoadForge test fails, it may be due to errors in your Locustfile. These could be simple Python syntax errors or issues with how the test is defined.
1. Use the Test Debugger
LoadForge provides a built-in test debugger that runs your test and attempts to send requests through it. This is the easiest way to diagnose common issues.
👉 Head over to the Test Debugger to get started.
If your test isn’t running, the debugger will highlight syntax errors, request failures, or misconfigurations in real time.
2. Test Locally
Before running a test in LoadForge, you can validate your Locustfile locally to catch syntax errors.
Check for Syntax Errors
To ensure your test script is correctly formatted, save it as a Python file (example.py
) and run:
This will catch basic Python syntax errors before you attempt a full test.
Run a Local Locust Test
To execute your test locally, first install Locust and dependencies:
Then, run your test using Locust:
This executes a 1-minute test with 10 sample users, helping you identify issues before deploying to LoadForge.
If your test runs locally but fails in LoadForge, check for network restrictions, authentication issues, or host validation problems.
3. Additional Debugging Tips
Use ChatGPT for Debugging
LoadForge test scripts follow a Locust-based format, which ChatGPT understands well. If you’re stuck, try:
- Copy-pasting your Locustfile into ChatGPT and asking it to check for errors.
- Describing your issue and asking for debugging advice.
- Requesting optimizations to improve script performance.
ChatGPT can help debug syntax errors, request failures, and suggest improvements to your load test.
Enable Logging in Locust
If you’re unsure what’s failing, enable verbose logging by modifying your script:
This will output detailed logs during the test execution, showing request failures and bottlenecks.
Check LoadForge Errors & Logs
If your test fails in LoadForge, check:
- Run Results Page for error messages.
- Response time metrics to see if timeouts are occurring.
- Error logs for HTTP status codes (e.g.,
401 Unauthorized
,500 Internal Server Error
).
4. Request Support
If you still need help, contact LoadForge support:
- Email: hello@loadforge.com
- Live Chat: Available directly in the LoadForge dashboard.
The LoadForge team is happy to assist with Locustfile issues, test configuration, and debugging complex scenarios.
If you’re unsure what’s wrong, share your test script and error logs with LoadForge support for faster troubleshooting.
By following these debugging steps, you can quickly diagnose and fix issues, ensuring smooth and reliable load tests in LoadForge!