joseluisll commented on code in PR #8638:
URL: https://github.com/apache/hadoop/pull/8638#discussion_r3675486534


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockTokenWithDFS.java:
##########
@@ -222,6 +224,26 @@ protected Configuration getConf(int numDataNodes) {
     return conf;
   }
 
+  /**
+   * A non-positive block token lifetime makes every block token expire at the
+   * instant it is created, so it must be rejected instead of failing later on
+   * every write pipeline.
+   */
+  @Test
+  public void testInvalidBlockTokenLifetime() {
+    for (long lifetime : new long[] {0, -1}) {
+      Configuration conf = getConf(1);
+      conf.setLong(DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_LIFETIME_KEY, 
lifetime);
+      HadoopIllegalArgumentException e = assertThrows(
+          HadoopIllegalArgumentException.class,
+          () -> new MiniDFSCluster.Builder(conf).numDataNodes(1).build());
+      assertTrue(
+          e.getMessage().contains(
+              DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_LIFETIME_KEY),
+          "unexpected message: " + e.getMessage());
+    }

Review Comment:
   Done, folded into the assertThrows call.



##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockTokenWithDFS.java:
##########
@@ -222,6 +224,26 @@ protected Configuration getConf(int numDataNodes) {
     return conf;
   }
 
+  /**
+   * A non-positive block token lifetime makes every block token expire at the
+   * instant it is created, so it must be rejected instead of failing later on
+   * every write pipeline.
+   */
+  @Test

Review Comment:
   Done, javadoc removed to match the rest of the class.



-- 
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