Updated guava version to 32.1.1 and added backoff logic for ShardSync Integration test
This commit is contained in:
parent
1e6506cf97
commit
b5228e80d8
2 changed files with 10 additions and 3 deletions
2
pom.xml
2
pom.xml
|
|
@ -55,7 +55,7 @@
|
|||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>31.0.1-jre</version>
|
||||
<version>32.1.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import com.amazonaws.services.kinesis.leases.impl.KinesisClientLease;
|
|||
import com.amazonaws.services.kinesis.leases.impl.KinesisClientLeaseManager;
|
||||
import com.amazonaws.services.kinesis.leases.interfaces.IKinesisClientLeaseManager;
|
||||
import com.amazonaws.services.kinesis.model.StreamStatus;
|
||||
import com.amazonaws.services.kinesis.model.LimitExceededException;
|
||||
|
||||
import static junit.framework.TestCase.fail;
|
||||
|
||||
|
|
@ -58,6 +59,8 @@ public class ShardSyncTaskIntegrationTest {
|
|||
private IKinesisProxy kinesisProxy;
|
||||
private final KinesisShardSyncer shardSyncer = new KinesisShardSyncer(new KinesisLeaseCleanupValidator());
|
||||
|
||||
private static final int retryBackoffMillis = 1000;
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
|
|
@ -71,9 +74,13 @@ public class ShardSyncTaskIntegrationTest {
|
|||
} catch (AmazonServiceException ase) {
|
||||
|
||||
}
|
||||
StreamStatus status;
|
||||
StreamStatus status = null;
|
||||
do {
|
||||
try {
|
||||
status = StreamStatus.fromValue(kinesis.describeStream(STREAM_NAME).getStreamDescription().getStreamStatus());
|
||||
} catch (LimitExceededException e) {
|
||||
Thread.sleep(retryBackoffMillis + (long) (Math.random() * 100));
|
||||
}
|
||||
} while (status != StreamStatus.ACTIVE);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue