You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by eb...@apache.org on 2019/12/17 17:37:14 UTC

[hadoop] branch branch-3.2 updated: YARN-10033. TestProportionalCapacityPreemptionPolicy not initializing vcores for effective max resources. Contributed by Eric Payne.

This is an automated email from the ASF dual-hosted git repository.

ebadger pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new 18b5153  YARN-10033. TestProportionalCapacityPreemptionPolicy not initializing vcores for effective max resources. Contributed by Eric Payne.
18b5153 is described below

commit 18b515322c557ffd96e6c3bce57080efbf71db18
Author: Eric Badger <eb...@verizonmedia.com>
AuthorDate: Tue Dec 17 17:36:52 2019 +0000

    YARN-10033. TestProportionalCapacityPreemptionPolicy not initializing vcores for effective max resources. Contributed by Eric Payne.
    
    (cherry picked from commit f47dcf2d4cf437dd67d14dd05c60648d9ff87843)
---
 .../TestProportionalCapacityPreemptionPolicy.java   | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

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 22a241f..2923906 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 class TestProportionalCapacityPreemptionPolicy {
         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
@@ -1095,7 +1095,8 @@ public class TestProportionalCapacityPreemptionPolicy {
     ProportionalCapacityPreemptionPolicy policy = new ProportionalCapacityPreemptionPolicy(
         rmContext, mCS, mClock);
     clusterResources = Resource.newInstance(
-        leafAbsCapacities(qData[0], qData[7]), 0);
+        leafAbsCapacities(qData[0], qData[7]),
+        leafAbsCapacities(qData[0], qData[7]));
     ParentQueue mRoot = buildMockRootQueue(rand, qData);
     when(mCS.getRootQueue()).thenReturn(mRoot);
 
@@ -1174,7 +1175,7 @@ public class TestProportionalCapacityPreemptionPolicy {
   Resource[] generateResourceList(int[] qData) {
     List<Resource> resourceList = new ArrayList<Resource>();
     for (int i = 0; i < qData.length; i++) {
-      resourceList.add(Resource.newInstance(qData[i], 0));
+      resourceList.add(Resource.newInstance(qData[i], qData[i]));
     }
     return resourceList.toArray(new Resource[resourceList.size()]);
   }
@@ -1206,16 +1207,16 @@ public class TestProportionalCapacityPreemptionPolicy {
     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;
@@ -1247,16 +1248,16 @@ public class TestProportionalCapacityPreemptionPolicy {
       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;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org