|
@@ -919,6 +919,36 @@ public class TestRMAppAttemptTransitions {
|
|
|
testAppAttemptFailedState(amContainer, diagnostics);
|
|
|
}
|
|
|
|
|
|
+ @Test(timeout = 10000)
|
|
|
+ public void testLaunchedAtFinalSaving() {
|
|
|
+ Container amContainer = allocateApplicationAttempt();
|
|
|
+
|
|
|
+ // ALLOCATED->FINAL_SAVING
|
|
|
+ applicationAttempt.handle(new RMAppAttemptEvent(applicationAttempt
|
|
|
+ .getAppAttemptId(), RMAppAttemptEventType.KILL));
|
|
|
+ assertEquals(RMAppAttemptState.FINAL_SAVING,
|
|
|
+ applicationAttempt.getAppAttemptState());
|
|
|
+
|
|
|
+ // verify for both launched and launch_failed transitions in final_saving
|
|
|
+ applicationAttempt.handle(new RMAppAttemptEvent(applicationAttempt
|
|
|
+ .getAppAttemptId(), RMAppAttemptEventType.LAUNCHED));
|
|
|
+ applicationAttempt.handle(new RMAppAttemptLaunchFailedEvent(
|
|
|
+ applicationAttempt.getAppAttemptId(), "Launch Failed"));
|
|
|
+
|
|
|
+ assertEquals(RMAppAttemptState.FINAL_SAVING,
|
|
|
+ applicationAttempt.getAppAttemptState());
|
|
|
+
|
|
|
+ testAppAttemptKilledState(amContainer, EMPTY_DIAGNOSTICS);
|
|
|
+
|
|
|
+ // verify for both launched and launch_failed transitions in killed
|
|
|
+ applicationAttempt.handle(new RMAppAttemptEvent(applicationAttempt
|
|
|
+ .getAppAttemptId(), RMAppAttemptEventType.LAUNCHED));
|
|
|
+ applicationAttempt.handle(new RMAppAttemptLaunchFailedEvent(
|
|
|
+ applicationAttempt.getAppAttemptId(), "Launch Failed"));
|
|
|
+ assertEquals(RMAppAttemptState.KILLED,
|
|
|
+ applicationAttempt.getAppAttemptState());
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testAMCrashAtAllocated() {
|
|
|
Container amContainer = allocateApplicationAttempt();
|