YARN-5023. TestAMRestart#testShouldNotCountFailureToMaxAttemptRetry fails. Contributed by sandflee

This commit is contained in:
Jian He 2016-07-01 14:28:43 -07:00
parent 4009fa3a92
commit c35a5a7a8d
3 changed files with 4 additions and 3 deletions

View File

@ -937,6 +937,10 @@ private static void waitForSchedulerAppAttemptAdded(
rm.getResourceScheduler()).getApplicationAttempt(attemptId));
}
/**
* NOTE: nm.nodeHeartbeat is explicitly invoked,
* don't invoke it before calling launchAM
*/
public static MockAM launchAM(RMApp app, MockRM rm, MockNM nm)
throws Exception {
RMAppAttempt attempt = waitForAttemptScheduled(app, rm);

View File

@ -208,8 +208,6 @@ public void testNMTokenSentForNormalContainer() throws Exception {
CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
cs.getApplicationAttempt(attempt.getAppAttemptId()).getNewContainerId();
// kick the scheduling
nm1.nodeHeartbeat(true);
MockAM am = MockRM.launchAM(app, rm, nm1);
// am container Id not equal to 1.
Assert.assertTrue(

View File

@ -473,7 +473,6 @@ public void testShouldNotCountFailureToMaxAttemptRetry() throws Exception {
appState.getAttempt(am4.getApplicationAttemptId())
.getAMContainerExitStatus());
// launch next AM in nm2
nm2.nodeHeartbeat(true);
MockAM am5 =
rm1.waitForNewAMToLaunchAndRegister(app1.getApplicationId(), 5, nm2);
RMAppAttempt attempt5 = app1.getCurrentAppAttempt();