aleios-cloud / sls-test-tools

Custom Jest Assertions for Serverless integration testing.
MIT License
192 stars 20 forks source link

add delay when polling the API in stepfunctions helper #52

Closed GuillaumeLagrange closed 2 years ago

GuillaumeLagrange commented 2 years ago

After ~70 seconds waiting for a step function to finish its execution, we receive a ThrottlingException: Rate exceeded

This PR adds a 1 second delay between API calls to avoid this. An improvement could be having this delay as a user setting, but it seemed a bit overkill to me, let me know if I should add it :)

According to https://docs.aws.amazon.com/step-functions/latest/dg/limits-overview.html The API as a bucket/refill of 200/5 for main AWS regions, and 100/2 for other regions. A 1 second delay should be more than enough to avoid this Quota :)