File tree 2 files changed +14
-3
lines changed
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ public Configuration createConfiguration() {
80
80
conf .setInt (ASYNC_DRAIN_THRESHOLD , Integer .MAX_VALUE );
81
81
// set the region to avoid the getBucketLocation on FS init.
82
82
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
+
83
92
return conf ;
84
93
}
85
94
Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ public class TestS3AAWSCredentialsProvider extends AbstractS3ATestBase {
86
86
87
87
private static final Logger LOG = LoggerFactory .getLogger (TestS3AAWSCredentialsProvider .class );
88
88
89
+ public static final int TERMINATION_TIMEOUT = 3 ;
90
+
89
91
@ Test
90
92
public void testProviderWrongClass () throws Exception {
91
93
expectProviderInstantiationFailure (this .getClass (),
@@ -579,7 +581,7 @@ protected AwsCredentials createCredentials(Configuration config) throws IOExcept
579
581
}
580
582
}
581
583
582
- private static final int CONCURRENT_THREADS = 10 ;
584
+ private static final int CONCURRENT_THREADS = 4 ;
583
585
584
586
@ Test
585
587
public void testConcurrentAuthentication () throws Throwable {
@@ -619,7 +621,7 @@ public void testConcurrentAuthentication() throws Throwable {
619
621
"expectedSecret" , credentials .secretAccessKey ());
620
622
}
621
623
} finally {
622
- pool .awaitTermination (10 , TimeUnit .SECONDS );
624
+ pool .awaitTermination (TERMINATION_TIMEOUT , TimeUnit .SECONDS );
623
625
pool .shutdown ();
624
626
}
625
627
@@ -685,7 +687,7 @@ public void testConcurrentAuthenticationError() throws Throwable {
685
687
);
686
688
}
687
689
} finally {
688
- pool .awaitTermination (10 , TimeUnit .SECONDS );
690
+ pool .awaitTermination (TERMINATION_TIMEOUT , TimeUnit .SECONDS );
689
691
pool .shutdown ();
690
692
}
691
693
You can’t perform that action at this time.
0 commit comments