Created
October 14, 2014 00:01
-
-
Save oza/dae760d4d02dddb550da to your computer and use it in GitHub Desktop.
test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test (timeout = 20000) | |
public void testRetriedFinishApplicationMasterRequest() | |
throws Exception { | |
conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, 1); | |
MemoryRMStateStore memStore = new MemoryRMStateStore(); | |
memStore.init(conf); | |
// start RM | |
rm1 = new MockRM(conf, memStore); | |
rm1.start(); | |
MockNM nm1 = | |
new MockNM("127.0.0.1:1234", 15120, rm1.getResourceTrackerService()); | |
nm1.registerNode(); | |
// create app and launch the AM | |
RMApp app0 = rm1.submitApp(200); | |
MockAM am0 = MockRM.launchAM(app0, rm1, nm1); | |
am0.registerAppAttempt(); | |
// start new RM | |
rm2 = new MockRM(conf, memStore); | |
rm2.start(); | |
rm2.waitForState(app0.getApplicationId(), RMAppState.ACCEPTED); | |
rm2.waitForState(am0.getApplicationAttemptId(), RMAppAttemptState.LAUNCHED); | |
am0.setAMRMProtocol(rm2.getApplicationMasterService(), rm2.getRMContext()); | |
am0.registerAppAttempt(true); | |
rm2.waitForState(app0.getApplicationId(), RMAppState.RUNNING); | |
rm2.waitForState(am0.getApplicationAttemptId(), RMAppAttemptState.RUNNING); | |
am0.unregisterAppAttempt(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment