You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/09/18 03:49:48 UTC

[GitHub] [iceberg] JonasJ-ap commented on a diff in pull request #5784: AWS: update AWS Integration Test to fix false positives

JonasJ-ap commented on code in PR #5784:
URL: https://github.com/apache/iceberg/pull/5784#discussion_r973655330


##########
aws/src/integration/java/org/apache/iceberg/aws/TestAssumeRoleAwsClientFactory.java:
##########
@@ -75,7 +75,7 @@ public void before() {
     assumeRoleProperties = Maps.newHashMap();
     assumeRoleProperties.put(AwsProperties.CLIENT_FACTORY, AssumeRoleAwsClientFactory.class.getName());
     assumeRoleProperties.put(AwsProperties.HTTP_CLIENT_TYPE, AwsProperties.HTTP_CLIENT_TYPE_APACHE);
-    assumeRoleProperties.put(AwsProperties.CLIENT_ASSUME_ROLE_REGION, "us-east-1");
+    assumeRoleProperties.put(AwsProperties.CLIENT_ASSUME_ROLE_REGION, AwsIntegTestUtil.testRegion());

Review Comment:
   If the bucket is created in a different region, we need to use the region specified by the user to perform integration tests. Otherwise, we may get a 400 bad request error when sending a request from `us-east-1`



##########
aws/src/integration/java/org/apache/iceberg/aws/TestDefaultAwsClientFactory.java:
##########
@@ -67,7 +67,7 @@ public void testS3FileIoCredentialsOverride() {
     AssertHelpers.assertThrows("Should fail request because of bad access key",
         S3Exception.class,
         "The AWS Access Key Id you provided does not exist in our records",
-        () -> s3Client.getObject(GetObjectRequest.builder().bucket("bucket").key("key").build()));
+        () -> s3Client.getObject(GetObjectRequest.builder().bucket(AwsIntegTestUtil.testBucketName()).key("key").build()));

Review Comment:
   If the bucket named "bucket" does not exist on the user's account or not created at the region specified by the user for this test, the request will throw an error message like:
   ```
   The bucket you are attempting to access must be addressed using the specified endpoint.....
   ```
   Hence, we need to use the bucket specified by the user instead to ensure the desired Exception is caught by the assertion statement



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org