slfan1989 commented on code in PR #4929:
URL: https://github.com/apache/hadoop/pull/4929#discussion_r1000889253


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestFederationInterceptorRESTRetry.java:
##########
@@ -377,48 +378,37 @@ public void testGetNodeOneBadOneGood()
    * composed of only 1 bad SubCluster.
    */
   @Test
-  public void testGetNodesOneBadSC()
-      throws YarnException, IOException, InterruptedException {
+  public void testGetNodesOneBadSC() throws Exception {
 
     setupCluster(Arrays.asList(bad2));
 
-    NodesInfo response = interceptor.getNodes(null);
-    Assert.assertNotNull(response);
-    Assert.assertEquals(0, response.getNodes().size());
-    // The remove duplicate operations is tested in TestRouterWebServiceUtil
+    LambdaTestUtils.intercept(YarnRuntimeException.class, "RM is stopped",
+        () -> interceptor.getNodes(null));
   }
 
   /**
    * This test validates the correctness of GetNodes in case the cluster is
    * composed of only 2 bad SubClusters.
    */
   @Test
-  public void testGetNodesTwoBadSCs()
-      throws YarnException, IOException, InterruptedException {
+  public void testGetNodesTwoBadSCs() throws Exception {
+
     setupCluster(Arrays.asList(bad1, bad2));
 
-    NodesInfo response = interceptor.getNodes(null);
-    Assert.assertNotNull(response);

Review Comment:
   In Federation mode, if there is a problem with some sub-clusters, we should 
throw an exception directly to tell the user a clear error message, and should 
not return a normal response with empty node list.



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