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

(cherry picked from commit c35a5a7a8d)
This commit is contained in:
Jian He 2016-07-01 14:28:43 -07:00
parent 2c6e7f221e
commit 4437e6f336
3 changed files with 4 additions and 3 deletions

View File

@ -864,6 +864,10 @@ public class MockRM extends ResourceManager {
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

@ -212,8 +212,6 @@ public class TestRM extends ParameterizedSchedulerTestBase {
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

@ -627,7 +627,6 @@ public class TestAMRestart {
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();