-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change STANDARD mode retry count for DynamoDB to match LEGACY same as…
… in V1
- Loading branch information
Showing
3 changed files
with
63 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"category": "Amazon DynamoDB", | ||
"contributor": "", | ||
"type": "feature", | ||
"description": "Change STANDARD mode retry count which was 2 for DynamoDB to match LEGACY retry count which is 8." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...amodb/src/test/java/software/amazon/awssdk/services/dynamodb/DynamoDbRetryPolicyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package software.amazon.awssdk.services.dynamodb; | ||
|
||
import org.junit.Test; | ||
import software.amazon.awssdk.core.SdkSystemSetting; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.retry.RetryPolicy; | ||
import software.amazon.awssdk.profiles.ProfileFileSystemSetting; | ||
import software.amazon.awssdk.testutils.EnvironmentVariableHelper; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class DynamoDbRetryPolicyTest { | ||
|
||
private static final EnvironmentVariableHelper ENVIRONMENT_VARIABLE_HELPER = new EnvironmentVariableHelper(); | ||
|
||
@Test | ||
public void test_numRetries_with_standardRetryPolicy() { | ||
ENVIRONMENT_VARIABLE_HELPER.set(SdkSystemSetting.AWS_RETRY_MODE.environmentVariable(), "standard"); | ||
System.setProperty(ProfileFileSystemSetting.AWS_PROFILE.property(), "default"); | ||
final SdkClientConfiguration sdkClientConfiguration = SdkClientConfiguration.builder().build(); | ||
final RetryPolicy retryPolicy = DynamoDbRetryPolicy.resolveRetryPolicy(sdkClientConfiguration); | ||
assertThat(retryPolicy.numRetries()).isEqualTo(8); | ||
} | ||
|
||
@Test | ||
public void test_numRetries_with_legacyRetryPolicy() { | ||
ENVIRONMENT_VARIABLE_HELPER.set(SdkSystemSetting.AWS_RETRY_MODE.environmentVariable(), "legacy"); | ||
System.setProperty(ProfileFileSystemSetting.AWS_PROFILE.property(), "default"); | ||
final SdkClientConfiguration sdkClientConfiguration = SdkClientConfiguration.builder().build(); | ||
final RetryPolicy retryPolicy = DynamoDbRetryPolicy.resolveRetryPolicy(sdkClientConfiguration); | ||
assertThat(retryPolicy.numRetries()).isEqualTo(8); | ||
} | ||
|
||
|
||
} |