cnauroth commented on code in PR #7566:
URL: https://github.com/apache/hadoop/pull/7566#discussion_r2061005400


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeRegistration.java:
##########
@@ -79,8 +80,12 @@ public void checkConnect(String host, int port) {
   @Test
   public void testDNSLookups() throws Exception {
     MonitorDNS sm = new MonitorDNS();
-    System.setSecurityManager(sm);
-    
+    try {
+      System.setSecurityManager(sm);
+    } catch (UnsupportedOperationException e) {
+      assumeTrue("Test is skipped because SecurityManager cannot be set (JEP 
411)", false);

Review Comment:
   I would prefer to not lose test coverage, but I don't have a good idea for a 
different way to implement this.



##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java:
##########
@@ -574,28 +575,36 @@ public void run() {
     };
 
     //use SecurityManager to pause the copying of f1 and begin copying f2
-    SecurityManager sm = System.getSecurityManager();
-    System.out.println("SecurityManager = " + sm);
-    System.setSecurityManager(new SecurityManager() {
-      private boolean firstTime = true;
+    SecurityManager sm = null;

Review Comment:
   I am a little unclear on what this part of the test is trying to achieve. 
@szetszwo , I think you introduced this all the way back in 
[HADOOP-999](https://issues.apache.org/jira/browse/HADOOP-999)! 😄 I don't want 
to lose test coverage, but I'm wondering if it's safe to remove the part of the 
code that works with `SecurityManager`.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to