YARN-7385. TestFairScheduler#testUpdateDemand and TestFSLeafQueue#testUpdateDemand are failing with NPE (yufeigu via rkanter)

This commit is contained in:
Robert Kanter 2017-10-24 13:36:50 -07:00
parent 1c5c2b5dde
commit 03af442e76
2 changed files with 3 additions and 0 deletions

View File

@ -88,6 +88,7 @@ public void testUpdateDemand() {
FSAppAttempt app = mock(FSAppAttempt.class);
Mockito.when(app.getDemand()).thenReturn(maxResource);
Mockito.when(app.getResourceUsage()).thenReturn(Resources.none());
schedulable.addApp(app, true);
schedulable.addApp(app, true);

View File

@ -5252,8 +5252,10 @@ public void testUpdateDemand() throws IOException {
FSAppAttempt app1 = mock(FSAppAttempt.class);
Mockito.when(app1.getDemand()).thenReturn(maxResource);
Mockito.when(app1.getResourceUsage()).thenReturn(Resources.none());
FSAppAttempt app2 = mock(FSAppAttempt.class);
Mockito.when(app2.getDemand()).thenReturn(maxResource);
Mockito.when(app2.getResourceUsage()).thenReturn(Resources.none());
QueueManager queueManager = scheduler.getQueueManager();
FSParentQueue queue1 = queueManager.getParentQueue("queue1", true);