SQOOP-3383: Disable FileSystem static cache in S3 tests
authorSzabolcs Vasas <vasas@apache.org>
Wed, 12 Sep 2018 07:00:02 +0000 (14:00 +0700)
committerSzabolcs Vasas <vasas@apache.org>
Wed, 12 Sep 2018 07:00:02 +0000 (14:00 +0700)
(Boglarka Egyed via Szabolcs Vasas)

src/test/org/apache/sqoop/testutil/S3TestUtils.java

index 7724026..0e6ef5b 100644 (file)
@@ -132,6 +132,11 @@ public class S3TestUtils {
             hadoopConf.set(Constants.SESSION_TOKEN, s3CredentialGenerator.getS3SessionToken());
             hadoopConf.set(Constants.AWS_CREDENTIALS_PROVIDER, TEMPORARY_CREDENTIALS_PROVIDER_CLASS);
         }
+
+        // FileSystem has a static cache that should be disabled during tests to make sure
+        // Sqoop relies on the S3 credentials set via the -D system properties.
+        // For details please see SQOOP-3383
+        hadoopConf.setBoolean("fs.s3a.impl.disable.cache", true);
     }
 
     public static ArgumentArrayBuilder getArgumentArrayBuilderForS3UnitTests(BaseSqoopTestCase testCase,