Browse Source

YARN-6461. TestRMAdminCLI has very low test timeouts. Contributed by Eric Badger

(cherry picked from commit 90d97372ed11aaa95d338db8583f578da159834a)
Jason Lowe 8 years ago
parent
commit
c5b1a8910d

+ 16 - 16
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRMAdminCLI.java

@@ -165,14 +165,14 @@ public class TestRMAdminCLI {
     dummyNodeLabelsManager.init(conf);
     dummyNodeLabelsManager.init(conf);
   }
   }
   
   
-  @Test(timeout=500)
+  @Test
   public void testRefreshQueues() throws Exception {
   public void testRefreshQueues() throws Exception {
     String[] args = { "-refreshQueues" };
     String[] args = { "-refreshQueues" };
     assertEquals(0, rmAdminCLI.run(args));
     assertEquals(0, rmAdminCLI.run(args));
     verify(admin).refreshQueues(any(RefreshQueuesRequest.class));
     verify(admin).refreshQueues(any(RefreshQueuesRequest.class));
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testRefreshUserToGroupsMappings() throws Exception {
   public void testRefreshUserToGroupsMappings() throws Exception {
     String[] args = { "-refreshUserToGroupsMappings" };
     String[] args = { "-refreshUserToGroupsMappings" };
     assertEquals(0, rmAdminCLI.run(args));
     assertEquals(0, rmAdminCLI.run(args));
@@ -180,7 +180,7 @@ public class TestRMAdminCLI {
         any(RefreshUserToGroupsMappingsRequest.class));
         any(RefreshUserToGroupsMappingsRequest.class));
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testRefreshSuperUserGroupsConfiguration() throws Exception {
   public void testRefreshSuperUserGroupsConfiguration() throws Exception {
     String[] args = { "-refreshSuperUserGroupsConfiguration" };
     String[] args = { "-refreshSuperUserGroupsConfiguration" };
     assertEquals(0, rmAdminCLI.run(args));
     assertEquals(0, rmAdminCLI.run(args));
@@ -188,14 +188,14 @@ public class TestRMAdminCLI {
         any(RefreshSuperUserGroupsConfigurationRequest.class));
         any(RefreshSuperUserGroupsConfigurationRequest.class));
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testRefreshAdminAcls() throws Exception {
   public void testRefreshAdminAcls() throws Exception {
     String[] args = { "-refreshAdminAcls" };
     String[] args = { "-refreshAdminAcls" };
     assertEquals(0, rmAdminCLI.run(args));
     assertEquals(0, rmAdminCLI.run(args));
     verify(admin).refreshAdminAcls(any(RefreshAdminAclsRequest.class));
     verify(admin).refreshAdminAcls(any(RefreshAdminAclsRequest.class));
   }
   }
 
 
-  @Test(timeout = 5000)
+  @Test
   public void testRefreshClusterMaxPriority() throws Exception {
   public void testRefreshClusterMaxPriority() throws Exception {
     String[] args = { "-refreshClusterMaxPriority" };
     String[] args = { "-refreshClusterMaxPriority" };
     assertEquals(0, rmAdminCLI.run(args));
     assertEquals(0, rmAdminCLI.run(args));
@@ -203,14 +203,14 @@ public class TestRMAdminCLI {
         any(RefreshClusterMaxPriorityRequest.class));
         any(RefreshClusterMaxPriorityRequest.class));
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testRefreshServiceAcl() throws Exception {
   public void testRefreshServiceAcl() throws Exception {
     String[] args = { "-refreshServiceAcl" };
     String[] args = { "-refreshServiceAcl" };
     assertEquals(0, rmAdminCLI.run(args));
     assertEquals(0, rmAdminCLI.run(args));
     verify(admin).refreshServiceAcls(any(RefreshServiceAclsRequest.class));
     verify(admin).refreshServiceAcls(any(RefreshServiceAclsRequest.class));
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testUpdateNodeResource() throws Exception {
   public void testUpdateNodeResource() throws Exception {
     String nodeIdStr = "0.0.0.0:0";
     String nodeIdStr = "0.0.0.0:0";
     int memSize = 2048;
     int memSize = 2048;
@@ -234,7 +234,7 @@ public class TestRMAdminCLI {
         resource);
         resource);
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testUpdateNodeResourceWithInvalidValue() throws Exception {
   public void testUpdateNodeResourceWithInvalidValue() throws Exception {
     String nodeIdStr = "0.0.0.0:0";
     String nodeIdStr = "0.0.0.0:0";
     int memSize = -2048;
     int memSize = -2048;
@@ -248,7 +248,7 @@ public class TestRMAdminCLI {
         any(UpdateNodeResourceRequest.class));
         any(UpdateNodeResourceRequest.class));
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testRefreshNodes() throws Exception {
   public void testRefreshNodes() throws Exception {
     String[] args = { "-refreshNodes" };
     String[] args = { "-refreshNodes" };
     assertEquals(0, rmAdminCLI.run(args));
     assertEquals(0, rmAdminCLI.run(args));
@@ -355,7 +355,7 @@ public class TestRMAdminCLI {
     assertEquals(-1, rmAdminCLI.run(invalidTrackingArgs));
     assertEquals(-1, rmAdminCLI.run(invalidTrackingArgs));
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testGetGroups() throws Exception {
   public void testGetGroups() throws Exception {
     when(admin.getGroupsForUser(eq("admin"))).thenReturn(
     when(admin.getGroupsForUser(eq("admin"))).thenReturn(
         new String[] {"group1", "group2"});
         new String[] {"group1", "group2"});
@@ -377,7 +377,7 @@ public class TestRMAdminCLI {
     }
     }
   }
   }
 
 
-  @Test(timeout = 500)
+  @Test
   public void testTransitionToActive() throws Exception {
   public void testTransitionToActive() throws Exception {
     String[] args = {"-transitionToActive", "rm1"};
     String[] args = {"-transitionToActive", "rm1"};
 
 
@@ -396,7 +396,7 @@ public class TestRMAdminCLI {
     verify(haadmin, times(1)).getServiceStatus();
     verify(haadmin, times(1)).getServiceStatus();
   }
   }
 
 
-  @Test(timeout = 500)
+  @Test
   public void testTransitionToStandby() throws Exception {
   public void testTransitionToStandby() throws Exception {
     String[] args = {"-transitionToStandby", "rm1"};
     String[] args = {"-transitionToStandby", "rm1"};
 
 
@@ -413,7 +413,7 @@ public class TestRMAdminCLI {
         any(HAServiceProtocol.StateChangeRequestInfo.class));
         any(HAServiceProtocol.StateChangeRequestInfo.class));
   }
   }
 
 
-  @Test(timeout = 500)
+  @Test
   public void testGetServiceState() throws Exception {
   public void testGetServiceState() throws Exception {
     String[] args = {"-getServiceState", "rm1"};
     String[] args = {"-getServiceState", "rm1"};
 
 
@@ -428,7 +428,7 @@ public class TestRMAdminCLI {
     verify(haadmin).getServiceStatus();
     verify(haadmin).getServiceStatus();
   }
   }
 
 
-  @Test(timeout = 500)
+  @Test
   public void testCheckHealth() throws Exception {
   public void testCheckHealth() throws Exception {
     String[] args = {"-checkHealth", "rm1"};
     String[] args = {"-checkHealth", "rm1"};
 
 
@@ -446,7 +446,7 @@ public class TestRMAdminCLI {
   /**
   /**
    * Test printing of help messages
    * Test printing of help messages
    */
    */
-  @Test(timeout=500)
+  @Test
   public void testHelp() throws Exception {
   public void testHelp() throws Exception {
     PrintStream oldOutPrintStream = System.out;
     PrintStream oldOutPrintStream = System.out;
     PrintStream oldErrPrintStream = System.err;
     PrintStream oldErrPrintStream = System.err;
@@ -583,7 +583,7 @@ public class TestRMAdminCLI {
     }
     }
   }
   }
 
 
-  @Test(timeout=500)
+  @Test
   public void testException() throws Exception {
   public void testException() throws Exception {
     PrintStream oldErrPrintStream = System.err;
     PrintStream oldErrPrintStream = System.err;
     ByteArrayOutputStream dataErr = new ByteArrayOutputStream();
     ByteArrayOutputStream dataErr = new ByteArrayOutputStream();