File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ public Configuration createConfiguration() {
8080 conf .setInt (ASYNC_DRAIN_THRESHOLD , Integer .MAX_VALUE );
8181 // set the region to avoid the getBucketLocation on FS init.
8282 conf .set (AWS_REGION , "eu-west-1" );
83+
84+ // tight retry logic as all failures are simulated
85+ final String interval = "1ms" ;
86+ final int limit = 3 ;
87+ conf .set (RETRY_THROTTLE_INTERVAL , interval );
88+ conf .setInt (RETRY_THROTTLE_LIMIT , limit );
89+ conf .set (RETRY_INTERVAL , interval );
90+ conf .setInt (RETRY_LIMIT , limit );
91+
8392 return conf ;
8493 }
8594
Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ public class TestS3AAWSCredentialsProvider extends AbstractS3ATestBase {
8686
8787 private static final Logger LOG = LoggerFactory .getLogger (TestS3AAWSCredentialsProvider .class );
8888
89+ public static final int TERMINATION_TIMEOUT = 3 ;
90+
8991 @ Test
9092 public void testProviderWrongClass () throws Exception {
9193 expectProviderInstantiationFailure (this .getClass (),
@@ -579,7 +581,7 @@ protected AwsCredentials createCredentials(Configuration config) throws IOExcept
579581 }
580582 }
581583
582- private static final int CONCURRENT_THREADS = 10 ;
584+ private static final int CONCURRENT_THREADS = 4 ;
583585
584586 @ Test
585587 public void testConcurrentAuthentication () throws Throwable {
@@ -619,7 +621,7 @@ public void testConcurrentAuthentication() throws Throwable {
619621 "expectedSecret" , credentials .secretAccessKey ());
620622 }
621623 } finally {
622- pool .awaitTermination (10 , TimeUnit .SECONDS );
624+ pool .awaitTermination (TERMINATION_TIMEOUT , TimeUnit .SECONDS );
623625 pool .shutdown ();
624626 }
625627
@@ -685,7 +687,7 @@ public void testConcurrentAuthenticationError() throws Throwable {
685687 );
686688 }
687689 } finally {
688- pool .awaitTermination (10 , TimeUnit .SECONDS );
690+ pool .awaitTermination (TERMINATION_TIMEOUT , TimeUnit .SECONDS );
689691 pool .shutdown ();
690692 }
691693
You can’t perform that action at this time.
0 commit comments