HDDS-16071. Add S3 Bucket Lifecycle CRUD integration tests to AbstractS3SDKV2Tests - #10986
HDDS-16071. Add S3 Bucket Lifecycle CRUD integration tests to AbstractS3SDKV2Tests#10986NickJavaDev88 wants to merge 2 commits into
Conversation
echonesis
left a comment
There was a problem hiding this comment.
Thanks @NickJavaDev88 for the patch.
| () -> s3Client.putBucketLifecycleConfiguration(b -> b | ||
| .bucket(nonExistentBucket) | ||
| .lifecycleConfiguration(validConfig))); | ||
| assertEquals(404, exception2.statusCode()); |
There was a problem hiding this comment.
Please use HTTP_NOT_FOUND instead of the hard-coded 404, consistent with the existing lifecycle tests.
| assertThrows(S3Exception.class, | ||
| () -> s3Client.getBucketLifecycleConfiguration(b -> b.bucket(bucketName))); |
There was a problem hiding this comment.
Could we assert HTTP_NOT_FOUND and S3ErrorTable.NO_SUCH_LIFECYCLE_CONFIGURATION.getCode(), as mentioned in the PR description? The same applies to the assertions below.
|
Thanks for the review, @echonesis — both addressed in 3b89d36 :
Verified locally: all 4 new lifecycle tests (testS3LifecycleConfigurationCreateSuccessfully, CreationFailed, Delete, Get) pass against a real MiniOzoneCluster in both AbstractS3SDKV1Tests and AbstractS3SDKV2Tests. |
What changes were proposed in this pull request?
This PR adds basic S3 Bucket Lifecycle CRUD integration tests to
AbstractS3SDKV2Teststo achieve test parity withAbstractS3SDKV1Tests.Key observations ported for AWS SDK v2:
getBucketLifecycleConfigurationthrows anS3Exception(404 /NoSuchLifecycleConfiguration) when no lifecycle configuration exists on a bucket (unlike SDK v1 which returnednull).deleteBucketLifecycleremains idempotent (204 No Content) when deleting a non-existent configuration, matching the fix from HDDS-16005.InvalidRequest(400).What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16071
How was this patch tested?
checkstyle.sh,rat.sh,author.sh) passed.mvn -pl :ozone-integration-test-s3 test -Dtest=TestS3SDK(194 tests passed).(Note: The single failure in
acceptanceis a known flaky test where SCM gets stuck in safe mode, unrelated to S3 SDK changes).