Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Testrail-api: the error "API Rate Limit Exceeded - 180 per minute maximum allowed" always appears although one request per 2 seconds

Hi everybody,

I get an error when adding test results to testrail using testrail.addResultForCase, the error “API Rate Limit Exceeded - 180 per minute maximum allowed” always appears although one request per 2 seconds.
I add a line code if(error) and wait 60 seconds, but the error still happens when I sent a request.
Please see the video for more detail: https://www.dropbox.com/s/agt52s5yh5h1n9m/Testrail-api.mov?dl=0

Can you help me? :(((((

Hi Duong,

If you do run into any rate limiting with your requests, you should get the 429 along with the message “API Rate Limit Exceeded - 180 per minute maximum allowed” and a “Retry-After” header. You can then parse the “Retry-After” header to automatically retry the API request after the specified number of seconds.

If you’re receiving any other errors when submitting API requests, please email contact@gurock with the errors you’re seeing and if possible details about the volume of requests and the types of requests themselves so that we can better assist you.

Additionally, we would typically recommend adding results in bulk (via the add_results or add_results_for_cases methods), and using other bulk methods where possible as this would reduce the number of requests as opposed to adding each result individually with a separate add_result request. Bulk methods can help with rate limit issues on TestRail Cloud (and with general performance related issues on TestRail Server as well).

1 Like

Got it, thanks vtran. I will try the add_results_for_case option, I hope it will work correctly