slfan1989 commented on code in PR #4396:
URL: https://github.com/apache/hadoop/pull/4396#discussion_r892486695
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java:
##########
@@ -898,4 +909,141 @@ public void testGetResourceTypeInfoRequest() throws
Exception {
interceptor.getResourceTypeInfo(GetAllResourceTypeInfoRequest.newInstance());
Assert.assertEquals(2, response.getResourceTypeInfo().size());
}
+
+ @Test
+ public void testFailApplicationAttempt() throws Exception {
+ LOG.info("Test FederationClientInterceptor : Fail Application Attempt
request.");
+
+ // null request
+ LambdaTestUtils.intercept(YarnException.class, "Missing
failApplicationAttempt request " +
+ "or applicationId or applicationAttemptId information.",
+ () -> interceptor.failApplicationAttempt(null));
+
+ // normal request
+ ApplicationId appId =
+ ApplicationId.newInstance(System.currentTimeMillis(), 1);
+ SubmitApplicationRequest request = mockSubmitApplicationRequest(appId,
APP_PRIORITY_ZERO);
+
+ // Submit the application
+ SubmitApplicationResponse response =
interceptor.submitApplication(request);
+
+ Assert.assertNotNull(response);
+ Assert.assertNotNull(stateStoreUtil.queryApplicationHomeSC(appId));
+
+ // Call GetApplicationAttempts
+ GetApplicationAttemptsRequest attemptsRequest =
+ GetApplicationAttemptsRequest.newInstance(appId);
+ GetApplicationAttemptsResponse attemptsResponse =
+ interceptor.getApplicationAttempts(attemptsRequest);
+
+ // Wait for app to start
+ while(attemptsResponse.getApplicationAttemptList().size() == 0) {
Review Comment:
Thanks for the suggestion, I will modify this part of the code.
--
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]