Skip to content

Add backoff with jitter to Kinesis stabiltiy test #6068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ public void tearDown() {
}

@RetryableTest(maxRetries = 3, retryableException = StabilityTestsRetryableException.class)
public void putRecords_subscribeToShard() {
public void putRecords_subscribeToShard() throws InterruptedException {
putRecords();
subscribeToShard();
}

/**
* We only have one run of subscribeToShard tests because it takes 5 minutes.
*/
private void subscribeToShard() {
private void subscribeToShard() throws InterruptedException {
log.info(() -> "starting to test subscribeToShard to stream: " + streamName);
List<CompletableFuture<?>> completableFutures = generateSubscribeToShardFutures();
StabilityTestRunner.newRunner()
Expand Down Expand Up @@ -170,12 +170,15 @@ private void putRecords() {
* Generate request per consumer/shard combination
* @return a lit of completablefutures
*/
private List<CompletableFuture<?>> generateSubscribeToShardFutures() {
private List<CompletableFuture<?>> generateSubscribeToShardFutures() throws InterruptedException {
List<CompletableFuture<?>> completableFutures = new ArrayList<>();
int baseDelay = 150;
int jitterRange = 150;
for (int i = 0; i < CONSUMER_COUNT; i++) {
final int consumerIndex = i;
for (int j = 0; j < SHARD_COUNT; j++) {
final int shardIndex = j;
Thread.sleep(baseDelay + (int)(Math.random() * jitterRange));
TestSubscribeToShardResponseHandler responseHandler =
new TestSubscribeToShardResponseHandler(consumerIndex, shardIndex);
CompletableFuture<Void> completableFuture =
Expand Down
Loading