diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java index d02950d..aac5f47 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java @@ -940,8 +940,8 @@ public void testPreemptionWithVCoreResource() { true); policy.editSchedule(); - // 5 containers will be preempted here - verify(mDisp, times(5)).handle(argThat(new IsPreemptionRequestFor(appA))); + // 4 containers will be preempted here + verify(mDisp, times(4)).handle(argThat(new IsPreemptionRequestFor(appA))); } @Test @@ -1205,16 +1205,16 @@ ParentQueue mockNested(Resource[] abs, int[] maxCap, Resource[] used, boolean preemptionDisabled = mockPreemptionStatus("root"); when(root.getPreemptionDisabled()).thenReturn(preemptionDisabled); QueueResourceQuotas rootQr = new QueueResourceQuotas(); - rootQr.setEffectiveMaxResource(Resource.newInstance(maxCap[0], 0)); + rootQr.setEffectiveMaxResource(Resource.newInstance(maxCap[0], maxCap[0])); rootQr.setEffectiveMinResource(abs[0]); rootQr.setEffectiveMaxResource(RMNodeLabelsManager.NO_LABEL, - Resource.newInstance(maxCap[0], 0)); + Resource.newInstance(maxCap[0], maxCap[0])); rootQr.setEffectiveMinResource(RMNodeLabelsManager.NO_LABEL, abs[0]); when(root.getQueueResourceQuotas()).thenReturn(rootQr); when(root.getEffectiveCapacity(RMNodeLabelsManager.NO_LABEL)) .thenReturn(abs[0]); when(root.getEffectiveMaxCapacity(RMNodeLabelsManager.NO_LABEL)) - .thenReturn(Resource.newInstance(maxCap[0], 0)); + .thenReturn(Resource.newInstance(maxCap[0], maxCap[0])); for (int i = 1; i < queues.length; ++i) { final CSQueue q; @@ -1246,16 +1246,16 @@ ParentQueue mockNested(Resource[] abs, int[] maxCap, Resource[] used, when(q.getQueueCapacities()).thenReturn(qc); QueueResourceQuotas qr = new QueueResourceQuotas(); - qr.setEffectiveMaxResource(Resource.newInstance(maxCap[i], 0)); + qr.setEffectiveMaxResource(Resource.newInstance(maxCap[i], maxCap[i])); qr.setEffectiveMinResource(abs[i]); qr.setEffectiveMaxResource(RMNodeLabelsManager.NO_LABEL, - Resource.newInstance(maxCap[i], 0)); + Resource.newInstance(maxCap[i], maxCap[i])); qr.setEffectiveMinResource(RMNodeLabelsManager.NO_LABEL, abs[i]); when(q.getQueueResourceQuotas()).thenReturn(qr); when(q.getEffectiveCapacity(RMNodeLabelsManager.NO_LABEL)) .thenReturn(abs[i]); when(q.getEffectiveMaxCapacity(RMNodeLabelsManager.NO_LABEL)) - .thenReturn(Resource.newInstance(maxCap[i], 0)); + .thenReturn(Resource.newInstance(maxCap[i], maxCap[i])); String parentPathName = p.getQueuePath(); parentPathName = (parentPathName == null) ? "root" : parentPathName;