|
@@ -714,6 +714,29 @@ public class TestRMAppTransitions {
|
|
|
verifyApplicationFinished(RMAppState.KILLED);
|
|
|
verifyAppRemovedSchedulerEvent(RMAppState.KILLED);
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testAppAcceptedAttemptKilled() throws IOException,
|
|
|
+ InterruptedException {
|
|
|
+ LOG.info("--- START: testAppAcceptedAttemptKilled ---");
|
|
|
+ RMApp application = testCreateAppAccepted(null);
|
|
|
+
|
|
|
+ // ACCEPTED => FINAL_SAVING event RMAppEventType.ATTEMPT_KILLED
|
|
|
+ // When application recovery happens for attempt is KILLED but app is
|
|
|
+ // RUNNING.
|
|
|
+ RMAppEvent event =
|
|
|
+ new RMAppEvent(application.getApplicationId(),
|
|
|
+ RMAppEventType.ATTEMPT_KILLED);
|
|
|
+ application.handle(event);
|
|
|
+ rmDispatcher.await();
|
|
|
+
|
|
|
+ assertAppState(RMAppState.FINAL_SAVING, application);
|
|
|
+ sendAppUpdateSavedEvent(application);
|
|
|
+ assertKilled(application);
|
|
|
+ assertAppFinalStateSaved(application);
|
|
|
+ verifyApplicationFinished(RMAppState.KILLED);
|
|
|
+ verifyAppRemovedSchedulerEvent(RMAppState.KILLED);
|
|
|
+ }
|
|
|
|
|
|
@Test
|
|
|
public void testAppRunningKill() throws IOException {
|