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

(cherry picked from commit 03af442e76)
This commit is contained in:
Robert Kanter 2017-10-24 13:36:50 -07:00
parent 8b200ab395
commit c5eeb2e4ce
2 changed files with 3 additions and 0 deletions

View File

@ -88,6 +88,7 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
FSAppAttempt app = mock(FSAppAttempt.class);
Mockito.when(app.getDemand()).thenReturn(maxResource);
Mockito.when(app.getResourceUsage()).thenReturn(Resources.none());
schedulable.addAppSchedulable(app);
schedulable.addAppSchedulable(app);

View File

@ -5249,8 +5249,10 @@ public class TestFairScheduler extends FairSchedulerTestBase {
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);