- * This is done by creating new FS instances and then - * requesting an on-demand transfer manager from the store. - * As this is only done once per FS instance, a new FS is - * required per test case. + * These tests are inevitably brittle against SDK updates. */ public class ITestAwsSdkWorkarounds extends AbstractS3ATestBase { @@ -53,13 +50,6 @@ public class ITestAwsSdkWorkarounds extends AbstractS3ATestBase { private static final Logger XFER_LOG = LoggerFactory.getLogger(AwsSdkWorkarounds.TRANSFER_MANAGER); - /** - * This is the string which keeps being printed. - * {@value}. - */ - private static final String FORBIDDEN = - "The provided S3AsyncClient is an instance of MultipartS3AsyncClient"; - /** * Marginal test run speedup by skipping needless test dir cleanup. * @throws IOException failure @@ -70,23 +60,7 @@ protected void deleteTestDirInTeardown() throws IOException { } /** - * Test instantiation with logging disabled. - */ - @Test - public void testQuietLogging() throws Throwable { - // simulate the base state of logging - noisyLogging(); - // creating a new FS switches to quiet logging - try (S3AFileSystem newFs = newFileSystem()) { - String output = createAndLogTransferManager(newFs); - Assertions.assertThat(output) - .describedAs("LOG output") - .doesNotContain(FORBIDDEN); - } - } - - /** - * Test instantiation with logging disabled. + * Test instantiation with logging enabled. */ @Test public void testNoisyLogging() throws Throwable { @@ -95,9 +69,8 @@ public void testNoisyLogging() throws Throwable { noisyLogging(); String output = createAndLogTransferManager(newFs); Assertions.assertThat(output) - .describedAs("LOG output does not contain the forbidden text." - + " Has the SDK been fixed?") - .contains(FORBIDDEN); + .describedAs("LOG output") + .isEmpty(); } } diff --git a/hadoop-tools/hadoop-aws/src/test/resources/log4j.properties b/hadoop-tools/hadoop-aws/src/test/resources/log4j.properties index 7b8dd3c11fcdc..737e4f7eef863 100644 --- a/hadoop-tools/hadoop-aws/src/test/resources/log4j.properties +++ b/hadoop-tools/hadoop-aws/src/test/resources/log4j.properties @@ -102,3 +102,6 @@ log4j.logger.org.apache.hadoop.fs.s3a.S3AStorageStatistics=INFO # services it launches itself. # log4.logger.org.apache.hadoop.service=DEBUG +# log this at trace to trigger enabling the +# log4j.logger.org.apache.hadoop.fs.s3a.DefaultS3ClientFactory=TRACE +