diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterForV1.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterForV1.java index 0e1310eb696..6fa133360f3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterForV1.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterForV1.java @@ -55,6 +55,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Test cases for authentication via TimelineAuthenticationFilter while @@ -62,6 +64,7 @@ */ @RunWith(Parameterized.class) public class TestTimelineAuthenticationFilterForV1 { + private static final Logger LOG = LoggerFactory.getLogger(TestTimelineAuthenticationFilterForV1.class); private static final String FOO_USER = "foo"; private static final String BAR_USER = "bar"; @@ -270,6 +273,7 @@ public UserGroupInformation call() throws Exception { httpUserClient.renewDelegationToken(token); Assert.fail(); } catch (Exception e) { + LOG.info("Received exception", e); Assert.assertTrue(e.getMessage().contains( "Renewal request for unknown token")); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/ResourceUsage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/ResourceUsage.java index 18fd6c3567d..decfd81b226 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/ResourceUsage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/ResourceUsage.java @@ -23,6 +23,8 @@ import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.nodelabels.CommonNodeLabelsManager; import org.apache.hadoop.yarn.util.resource.Resources; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Resource Usage by Labels for following fields by label - AM resource (to @@ -34,6 +36,7 @@ * And it is thread-safe */ public class ResourceUsage extends AbstractResourceUsage { + private static final Logger LOG = LoggerFactory.getLogger(ResourceUsage.class); // short for no-label :) private static final String NL = CommonNodeLabelsManager.NO_LABEL; @@ -99,6 +102,7 @@ public Resource getPending(String label) { } public void incPending(String label, Resource res) { + LOG.debug("***Increasing pending res with: " + res); _inc(label, ResourceType.PENDING, res); } @@ -111,6 +115,7 @@ public void decPending(Resource res) { } public void decPending(String label, Resource res) { + LOG.debug("***Decreasing pending res with: " + res); _dec(label, ResourceType.PENDING, res); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java index e9575b9d5dd..b989feac3dc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java @@ -36,13 +36,12 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.FastDateFormat; -import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; -import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting; +import org.apache.hadoop.thirdparty.com.google.common.base.Preconditions; +import org.apache.hadoop.thirdparty.com.google.common.collect.ConcurrentHashMultiset; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport; @@ -78,6 +77,8 @@ import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerUpdatesAcquiredEvent; import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeCleanContainerEvent; import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeUpdateContainerEvent; +import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; +import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.SchedulingMode; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.ContainerRequest; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.PendingAsk; @@ -89,10 +90,8 @@ import org.apache.hadoop.yarn.util.SystemClock; import org.apache.hadoop.yarn.util.resource.ResourceCalculator; import org.apache.hadoop.yarn.util.resource.Resources; - -import org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting; -import org.apache.hadoop.thirdparty.com.google.common.base.Preconditions; -import org.apache.hadoop.thirdparty.com.google.common.collect.ConcurrentHashMultiset; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Represents an application attempt from the viewpoint of the scheduler. @@ -1307,7 +1306,9 @@ public boolean hasPendingResourceRequest(String nodePartition, nodePartition = RMNodeLabelsManager.NO_LABEL; } + LOG.debug("***attempt: " + this.toString() + " check pending resource for partition: " + nodePartition); Resource pending = attemptResourceUsage.getPending(nodePartition); + LOG.debug("***attempt: " + this.toString() + " pending resource for partition: " + pending); // TODO, need consider node partition here // To avoid too many allocation-proposals rejected for non-default @@ -1316,6 +1317,7 @@ public boolean hasPendingResourceRequest(String nodePartition, pending = Resources.subtractNonNegative(pending, Resources .createResource(unconfirmedAllocatedMem.get(), unconfirmedAllocatedVcores.get())); + LOG.debug("***attempt: " + this.toString() + " modified pending resource for partition: " + pending); } return !Resources.isNone(pending); @@ -1497,4 +1499,11 @@ public String getPartition() { public long getStartTime() { return startTime; } + + @Override + public String toString() { + return "SchedulerApplicationAttempt{" + + "attemptId=" + attemptId + + '}'; + } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java index 36f831dca94..6e60862d786 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java @@ -287,6 +287,7 @@ public void setResourceCalculator(ResourceCalculator rc) { @Override public int getNumClusterNodes() { + LOG.debug("***Called real getNumClusterNodes"); return nodeTracker.nodeCount(); } @@ -3014,13 +3015,16 @@ public void submitResourceCommitRequest(Resource cluster, createResourceCommitRequest(csAssignment); if (null == request) { + LOG.debug("***request was null"); return; } if (scheduleAsynchronously) { + LOG.debug("***scheduleAsynchronously=true"); // Submit to a commit thread and commit it async-ly resourceCommitterService.addNewCommitRequest(request); } else{ + LOG.debug("***scheduleAsynchronously=false"); // Otherwise do it sync-ly. tryCommit(cluster, request, true); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java index 104a89caee0..6ed27c06702 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java @@ -713,6 +713,11 @@ public Resource getUserAMResourceLimitPerPartition( effectiveUserLimit = Math.min(effectiveUserLimit * userWeight, 1.0f); Resource queuePartitionResource = getEffectiveCapacity(nodePartition); + LOG.info("queuePartitionResource: " + queuePartitionResource + ", " + + "nodePartition: " + nodePartition + ", " + + "queueCapacities.getMaxAMResourcePercentage(nodePartition): " + queueCapacities.getMaxAMResourcePercentage(nodePartition) + ", " + + "effectiveUserLimit: " + effectiveUserLimit + ", " + + "usersManager.getUserLimitFactor(): " + usersManager.getUserLimitFactor()); Resource userAMLimit = Resources.multiplyAndNormalizeUp( resourceCalculator, queuePartitionResource, @@ -752,7 +757,7 @@ public Resource getUserAMResourceLimitPerPartition( Resources.clone(getAMResourceLimitPerPartition(nodePartition))); queueUsage.setUserAMLimit(nodePartition, preWeighteduserAMLimit); - LOG.debug("Effective user AM limit for \"{}\":{}. Effective weighted" + LOG.info("Effective user AM limit for \"{}\":{}. Effective weighted" + " user AM limit: {}. User weight: {}", userName, preWeighteduserAMLimit, userAMLimit, userWeight); return userAMLimit; @@ -1251,6 +1256,7 @@ public CSAssignment assignContainers(Resource clusterResource, } } if (!userAssignable) { + LOG.debug("***NOT USER ASSIGNABLE"); application.updateAMContainerDiagnostics(AMState.ACTIVATED, "User capacity has reached its maximum limit."); ActivitiesLogger.APP.recordRejectedAppActivityFromLeafQueue( @@ -1260,6 +1266,9 @@ public CSAssignment assignContainers(Resource clusterResource, } // Try to schedule + LOG.debug("**Trying to assign containers. Cluster res: " + clusterResource + + "candidates: " + candidates + ", " + "currentResourceLimits: " + currentResourceLimits + ", " + + "schedulingMode: " + schedulingMode); assignment = application.assignContainers(clusterResource, candidates, currentResourceLimits, schedulingMode, null); @@ -1271,6 +1280,7 @@ public CSAssignment assignContainers(Resource clusterResource, // Did we schedule or reserve a container? Resource assigned = assignment.getResource(); + LOG.debug("***assignment: " + assignment); if (Resources.greaterThan(resourceCalculator, clusterResource, assigned, Resources.none())) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/AbstractContainerAllocator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/AbstractContainerAllocator.java index 90b088efdfd..bcca85fb5dc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/AbstractContainerAllocator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/AbstractContainerAllocator.java @@ -71,6 +71,10 @@ public AbstractContainerAllocator(FiCaSchedulerApp application, protected CSAssignment getCSAssignmentFromAllocateResult( Resource clusterResource, ContainerAllocation result, RMContainer rmContainer, FiCaSchedulerNode node) { + LOG.debug("***getCSAssignmentFromAllocateResult: " + + "clusterResource: " + clusterResource + ", " + + "result: " + result + ", " + + "rmContainer: " + rmContainer); // Handle skipped CSAssignment.SkippedType skipped = (result.getAllocationState() == AllocationState.APP_SKIPPED) ? diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/ContainerAllocation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/ContainerAllocation.java index b9b9bcff2f6..6718ee1b659 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/ContainerAllocation.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/ContainerAllocation.java @@ -104,4 +104,17 @@ public void setToKillContainers(List toKillContainers) { public List getToKillContainers() { return toKillContainers; } + + @Override + public String toString() { + return "ContainerAllocation{" + +// "containerToBeUnreserved=" + containerToBeUnreserved + + ", resourceToBeAllocated=" + resourceToBeAllocated + + ", state=" + state + + ", containerNodeType=" + containerNodeType + + ", requestLocalityType=" + requestLocalityType + +// ", updatedContainer=" + updatedContainer + +// ", toKillContainers=" + toKillContainers + + '}'; + } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java index cced238b601..62cbeb278c5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java @@ -309,6 +309,10 @@ private boolean canAssign(SchedulerRequestKey schedulerKey, } // If there are no nodes in the cluster, return false. if (rmContext.getScheduler().getNumClusterNodes() == 0) { + LOG.debug("******Can't assign container, no nodes... " + + "rmContext: " + Integer.toHexString(rmContext.hashCode()) + ", " + + "scheduler: " + Integer.toHexString(rmContext.getScheduler().hashCode()) + ); return false; } @@ -330,15 +334,21 @@ private boolean canAssign(SchedulerRequestKey schedulerKey, // If rack locality additional delay parameter is enabled. if (application.getCSLeafQueue().getRackLocalityAdditionalDelay() > -1) { - return missedOpportunities > getActualRackLocalityDelay(); + boolean b = missedOpportunities > getActualRackLocalityDelay(); + if (!b) { + LOG.debug("******Can't assign container, missed opportunities"); + } + return b; } else { long requiredContainers = application.getOutstandingAsksCount(schedulerKey); float localityWaitFactor = getLocalityWaitFactor(uniqLocationAsks, rmContext.getScheduler().getNumClusterNodes()); // Cap the delay by the number of nodes in the cluster. - return (Math.min(rmContext.getScheduler().getNumClusterNodes(), - (requiredContainers * localityWaitFactor)) < missedOpportunities); + boolean b = Math.min(rmContext.getScheduler().getNumClusterNodes(), + (requiredContainers * localityWaitFactor)) < missedOpportunities; + LOG.debug("******Can't assign container, delay"); + return b; } } @@ -362,7 +372,7 @@ private boolean canAssign(SchedulerRequestKey schedulerKey, return application.getOutstandingAsksCount(schedulerKey, node.getNodeName()) > 0; } - + LOG.debug("******Simply returning false"); return false; } @@ -427,6 +437,7 @@ private ContainerAllocation assignContainersOnNode(Resource clusterResource, PendingAsk nodeLocalAsk = application.getPendingAsk(schedulerKey, node.getNodeName()); if (nodeLocalAsk.getCount() > 0) { + LOG.debug("*****Assigning node local container"); requestLocalityType = NodeType.NODE_LOCAL; allocation = assignNodeLocalContainers(clusterResource, nodeLocalAsk, @@ -455,6 +466,7 @@ private ContainerAllocation assignContainersOnNode(Resource clusterResource, NodeType.RACK_LOCAL : requestLocalityType; + LOG.debug("*****Assigning rack local container"); allocation = assignRackLocalContainers(clusterResource, rackLocalAsk, node, schedulerKey, reservedContainer, schedulingMode, @@ -482,6 +494,7 @@ private ContainerAllocation assignContainersOnNode(Resource clusterResource, NodeType.OFF_SWITCH : requestLocalityType; + LOG.debug("*****Assigning off-switch container"); allocation = assignOffSwitchContainers(clusterResource, offSwitchAsk, node, schedulerKey, reservedContainer, schedulingMode, @@ -859,6 +872,7 @@ private ContainerAllocation allocate(Resource clusterResource, if (reservedContainer == null) { result = preCheckForNodeCandidateSet(clusterResource, node, schedulingMode, resourceLimits, schedulerKey); + LOG.debug("****precheckresult: " + result); if (null != result) { continue; } @@ -874,9 +888,11 @@ private ContainerAllocation allocate(Resource clusterResource, result = tryAllocateOnNode(clusterResource, node, schedulingMode, resourceLimits, schedulerKey, reservedContainer); + LOG.debug("****tryAllocateOnNode result: " + result); if (AllocationState.ALLOCATED == result.getAllocationState()) { result = doAllocation(result, node, schedulerKey, reservedContainer); + LOG.debug("****tryAllocateOnNode result: " + result); break; } @@ -919,6 +935,7 @@ public CSAssignment assignContainers(Resource clusterResource, activitiesManager, node, application, null, ActivityDiagnosticConstant.APPLICATION_DO_NOT_NEED_RESOURCE, ActivityLevel.APP); + LOG.debug("***CSAssignment.SKIP_ASSIGNMENT1"); return CSAssignment.SKIP_ASSIGNMENT; } @@ -929,6 +946,7 @@ public CSAssignment assignContainers(Resource clusterResource, AllocationState allocationState = result.getAllocationState(); if (allocationState == AllocationState.PRIORITY_SKIPPED) { + LOG.debug("***Priority skipped"); continue; } return getCSAssignmentFromAllocateResult(clusterResource, result, @@ -937,6 +955,7 @@ public CSAssignment assignContainers(Resource clusterResource, // We will reach here if we skipped all priorities of the app, so we will // skip the app. + LOG.debug("***CSAssignment.SKIP_ASSIGNMENT2"); return CSAssignment.SKIP_ASSIGNMENT; } else { ContainerAllocation result = diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java index a9cee2ddcbd..36bcc3e2f55 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java @@ -33,6 +33,7 @@ import org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableMap; import org.apache.hadoop.test.GenericTestUtils; +import org.apache.log4j.LogManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; @@ -105,7 +106,8 @@ public void setUp() throws Exception { CapacityScheduler spyCs = new CapacityScheduler(); cs = spy(spyCs); rmContext = TestUtils.getMockRMContext(); - + org.apache.log4j.Logger rootLogger = LogManager.getRootLogger(); + rootLogger.setLevel(org.apache.log4j.Level.DEBUG); } private void setup(CapacitySchedulerConfiguration csConf) throws Exception { @@ -114,7 +116,10 @@ private void setup(CapacitySchedulerConfiguration csConf) throws Exception { private void setup(CapacitySchedulerConfiguration csConf, boolean addUserLimits) throws Exception { - + // THIS WORKS WELL! + // when(cs.getNumClusterNodes()).thenReturn(3); + // LOG.debug("TEST INIT1, cs: " + cs + ", numnodes: " + cs.getNumClusterNodes()); + csConf.setBoolean(CapacitySchedulerConfiguration.ENABLE_USER_METRICS, true); final String newRoot = "root" + System.currentTimeMillis(); // final String newRoot = "root"; @@ -157,7 +162,15 @@ private void setup(CapacitySchedulerConfiguration csConf, cs.init(csConf); cs.start(); + // THIS DOES NOT WORK IN ALL RUNS when(cs.getNumClusterNodes()).thenReturn(3); + //assertEquals(3, cs.getNumClusterNodes()); + LOG.debug("TEST INIT1, cs: " + cs + ", numnodes: " + cs.getNumClusterNodes()); + LOG.debug("TEST INIT... rmContext: " + Integer.toHexString(spyRMContext.hashCode()) + + ", scheduler: " + Integer.toHexString(cs.hashCode()) + + ", rmContext.getScheduler: " + Integer.toHexString(spyRMContext.getScheduler().hashCode()) + + ", nodes#1: " + spyRMContext.getScheduler().getNumClusterNodes() + + ", nodes#2: " + cs.getNumClusterNodes()); } private static final String A = "a";