-
Notifications
You must be signed in to change notification settings - Fork 10
blobstore: onboard retry config in the client and aws #113
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #113 +/- ##
============================================
+ Coverage 82.51% 83.06% +0.54%
Complexity 36 36
============================================
Files 143 148 +5
Lines 7258 7635 +377
Branches 832 888 +56
============================================
+ Hits 5989 6342 +353
- Misses 845 859 +14
- Partials 424 434 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ncBlobStore Add comprehensive test coverage for retry configuration functionality introduced in PR salesforce#113 for three key files: - BlobStoreBuilder.withRetryConfig() method - AwsBlobStore retry configuration - AwsAsyncBlobStore retry configuration Tests cover: - Exponential and fixed retry modes - Null maxAttempts (AWS SDK defaults) - Attempt and total timeout configurations - Default behavior without retry config - CRT async client with retry config Total: 13 new test methods across both test classes
Enhanced test coverage for retry configuration in AwsBlobStore and AwsAsyncBlobStore to cover lines 540-549 where the actual retry strategy and timeout configurations are set. Changes: - Added Consumer import for proper method signature disambiguation - Updated tests to mock overrideConfiguration with proper typing - Added verification that overrideConfiguration is actually called - Tests now properly exercise the retry config lambda execution path This ensures the retry strategy conversion and timeout settings in the overrideConfiguration callbacks are properly tested.
Simplified retry configuration tests to work with the existing static mock from @beforeeach setup. The previous approach was creating new static mocks which conflicted with the existing mock. Changes: - Removed duplicate static mock creation in individual tests - Tests now use the existing mock from setup - All tests pass successfully - Maintains test coverage for retry config functionality
Updated test setup in @beforeeach to properly execute the overrideConfiguration lambda, which now actually covers lines 540-549 in both AwsBlobStore and AwsAsyncBlobStore. Changes: - Added doAnswer to execute the Consumer lambda in overrideConfiguration - Mock ClientOverrideConfiguration.Builder to accept retry strategy calls - Use correct type (RetryStrategy) for retryStrategy mock - Skip CRT builder override configuration (not supported) This ensures the retry configuration code in lines 540-549 is now properly tested and covered.
| Duration.ofMillis(retryConfig.getMaxDelayMillis()) | ||
| ) | ||
| ); | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happen if the retryConfig.getMode() is null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, i think that's a valid case if we user just wants to set the maxAttempts without configuring timeouts, let me make this else condition into an if
| * <p>Example usage: | ||
| * <pre>{@code | ||
| * // Exponential backoff with 3 retries | ||
| * RetryConfig exponentialConfig = RetryConfig.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have these retry parameters supported in all substrate?
Allow users to set only maxAttempts without specifying a retry mode, which will use AWS SDK's default backoff strategy. Refactored the method to use early returns instead of nested if-else for better readability.
Summary
Some conventions to follow
docstore:for document store module,blobstorefor Blob Store moduletest:perf: