Add backoff with jitter to Kinesis stabiltiy test #6068
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The Kinesis Stability test was previously failing due to an eventual consistency - was fixed in #6006.
After the fix, the test was still failing because the subscribeToShard() call is hitting server side rate limit, and because of a customization that prevents retries on this operation, the test cannot take advantage of the retry policy of using exponential backoff with jitter.
In this test, I added manual backoff with jitter to space out the requests and avoid rate limiting.
Testing
Testing with a @RepeatedTest() suites running 8 times in a row.
Before the change
1 failed 1 passed 6 ignored (meaning they failed, retried up to 3 times and eventually succeeded)
duration: 5min and 22-31 seconds
After the change
8 passed.
duration: 5min and 26-34 seconds