YARN-8541 (branch-3.1 addendum): RM startup failure on recovery after user deletion

This commit is contained in:
Jonathan Hung 2019-09-09 20:15:42 -07:00
parent aee8fb567b
commit 80735a15a5
1 changed files with 8 additions and 12 deletions

View File

@ -83,16 +83,11 @@ public class TestPlacementManager {
ApplicationSubmissionContext asc = Records.newRecord(
ApplicationSubmissionContext.class);
asc.setQueue(YarnConfiguration.DEFAULT_QUEUE_NAME);
asc.setApplicationName(APP_NAME);
boolean caughtException = false;
try{
pm.placeApplication(asc, USER2);
} catch (Exception e) {
caughtException = true;
}
Assert.assertTrue(caughtException);
Assert.assertNull("Placement should be null",
pm.placeApplication(asc, USER2));
QueueMappingEntity queueMappingEntity = new QueueMappingEntity(APP_NAME,
USER1, PARENT_QUEUE);
@ -100,12 +95,13 @@ public class TestPlacementManager {
Arrays.asList(queueMappingEntity));
queuePlacementRules.add(anRule);
pm.updateRules(queuePlacementRules);
try{
pm.placeApplication(asc, USER2);
try {
ApplicationPlacementContext pc = pm.placeApplication(asc, USER2);
Assert.assertNotNull(pc);
} catch (Exception e) {
caughtException = false;
e.printStackTrace();
Assert.fail("Exception not expected");
}
Assert.assertFalse(caughtException);
}
}