steveloughran commented on code in PR #5948:
URL: https://github.com/apache/hadoop/pull/5948#discussion_r1303370942


##########
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AConfiguration.java:
##########
@@ -511,6 +513,34 @@ public void testConfOptionPropagationToFS() throws 
Exception {
     assertOptionEquals(updated, "fs.s3a.propagation", "propagated");
   }
 
+  @Test(timeout = 10_000L)
+  public void testConnectTtlPropagation() throws Exception {
+    Configuration config = new Configuration();
+    ClientConfiguration awsConf  = new ClientConfiguration();
+    initConnectionSettings(config, awsConf);
+    Assertions.assertThat(awsConf.getConnectionTTL())
+            .describedAs(String.format("connection ttl should be set to 
default value as" +

Review Comment:
   you don't need to use string.format; described as does it anyway
   ```
   describedAs("should be set to %s", value)
   ```
   



##########
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AConfiguration.java:
##########
@@ -511,6 +513,34 @@ public void testConfOptionPropagationToFS() throws 
Exception {
     assertOptionEquals(updated, "fs.s3a.propagation", "propagated");
   }
 
+  @Test(timeout = 10_000L)
+  public void testConnectTtlPropagation() throws Exception {
+    Configuration config = new Configuration();
+    ClientConfiguration awsConf  = new ClientConfiguration();
+    initConnectionSettings(config, awsConf);
+    Assertions.assertThat(awsConf.getConnectionTTL())
+            .describedAs(String.format("connection ttl should be set to 
default value as" +
+                    " %s is not set", CONNECTION_TTL))
+            .isEqualTo(DEFAULT_CONNECTION_TTL);
+    long connectionTtlTestVal = 1000;
+    config.setLong(CONNECTION_TTL, connectionTtlTestVal);
+    initConnectionSettings(config, awsConf);
+    Assertions.assertThat(awsConf.getConnectionTTL())
+            .describedAs(String.format("%s not propagated to aws conf", 
CONNECTION_TTL))

Review Comment:
   same



##########
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AConfiguration.java:
##########
@@ -511,6 +513,34 @@ public void testConfOptionPropagationToFS() throws 
Exception {
     assertOptionEquals(updated, "fs.s3a.propagation", "propagated");
   }
 
+  @Test(timeout = 10_000L)
+  public void testConnectTtlPropagation() throws Exception {
+    Configuration config = new Configuration();
+    ClientConfiguration awsConf  = new ClientConfiguration();
+    initConnectionSettings(config, awsConf);
+    Assertions.assertThat(awsConf.getConnectionTTL())
+            .describedAs(String.format("connection ttl should be set to 
default value as" +
+                    " %s is not set", CONNECTION_TTL))
+            .isEqualTo(DEFAULT_CONNECTION_TTL);
+    long connectionTtlTestVal = 1000;
+    config.setLong(CONNECTION_TTL, connectionTtlTestVal);
+    initConnectionSettings(config, awsConf);
+    Assertions.assertThat(awsConf.getConnectionTTL())
+            .describedAs(String.format("%s not propagated to aws conf", 
CONNECTION_TTL))
+            .isEqualTo(connectionTtlTestVal);
+
+    long connectionTtlTestVal1 = -1;
+    config.setLong(CONNECTION_TTL, connectionTtlTestVal1);
+    initConnectionSettings(config, awsConf);
+    Assertions.assertThat(awsConf.getConnectionTTL())

Review Comment:
   same



##########
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AConfiguration.java:
##########
@@ -511,6 +513,34 @@ public void testConfOptionPropagationToFS() throws 
Exception {
     assertOptionEquals(updated, "fs.s3a.propagation", "propagated");
   }
 
+  @Test(timeout = 10_000L)
+  public void testConnectTtlPropagation() throws Exception {
+    Configuration config = new Configuration();

Review Comment:
   or create a configuration with "false" so it is completely empty



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to