Skip to content

Conversation

@sandeepvinayak
Copy link
Contributor

Summary

Some conventions to follow

  1. add the module name as a prefix
  • for example: if your change is for blob store, add a prefix: docstore: for document store module, blobstore for Blob Store module
  1. for a test only PR, add test:
  2. for a perf improvement only PR, add perf:

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.06%. Comparing base (3511698) to head (7a910c6).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...alesforce/multicloudj/blob/aws/AwsTransformer.java 92.00% 1 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
unittests 83.06% <96.00%> (+0.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…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.
@sandeepvinayak sandeepvinayak changed the title blobstore: onboard retry config in the client blobstore: onboard retry config in the client and aws Nov 6, 2025
@sandeepvinayak sandeepvinayak enabled auto-merge (squash) November 6, 2025 19:59
Duration.ofMillis(retryConfig.getMaxDelayMillis())
)
);
} else {
Copy link
Collaborator

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?

Copy link
Contributor Author

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()
Copy link
Collaborator

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.
@sandeepvinayak sandeepvinayak merged commit 8df8d31 into salesforce:main Nov 6, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants