slfan1989 commented on code in PR #6139:
URL: https://github.com/apache/hadoop/pull/6139#discussion_r1343606908
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimitsByPartition.java:
##########
@@ -1027,4 +1027,83 @@ public void testAMLimitByAllResources() throws Exception
{
rm.close();
}
+
+ @Test(timeout = 120000)
+ public void testDiagnosticWhenAMActivated() throws Exception {
+ /*
+ * Test Case:
+ * Verify AM resource limit per partition level and per queue level. So
+ * we use 2 queues to verify this case.
+ * Queue a1 supports labels (x,y). Configure am-resource-limit as 0.2 (x)
+ * Queue c1 supports default label. Configure am-resource-limit as 0.2
+ *
+ * Queue A1 for label X can only support 2Gb AM resource.
+ * Queue C1 (empty label) can support 2Gb AM resource.
+ *
+ * Verify atleast one AM is launched, and AM resources should not go more
+ * than 2GB in each queue.
+ */
+
+ simpleNodeLabelMappingToManager();
+ CapacitySchedulerConfiguration config = (CapacitySchedulerConfiguration)
+ TestUtils.getConfigurationWithQueueLabels(conf);
+
+ // After getting queue conf, configure AM resource percent for Queue A1
+ // as 0.2 (Label X) and for Queue C1 as 0.2 (Empty Label)
+ final String A1 = CapacitySchedulerConfiguration.ROOT + ".a" + ".a1";
+ final String C1 = CapacitySchedulerConfiguration.ROOT + ".c" + ".c1";
+ config.setMaximumAMResourcePercentPerPartition(A1, "x", 0.2f);
+ config.setMaximumApplicationMasterResourcePerQueuePercent(C1, 0.2f);
+
+ // Now inject node label manager with this updated config
+ MockRM rm1 = new MockRM(config) {
+ @Override
+ public RMNodeLabelsManager createNodeLabelManager() {
+ return mgr;
+ }
+ };
+
+ rm1.getRMContext().setNodeLabelManager(mgr);
+ rm1.start();
+ MockNM nm1 = rm1.registerNode("h1:1234", 10 * GB); // label = x
+ rm1.registerNode("h2:1234", 10 * GB); // label = y
+ MockNM nm3 = rm1.registerNode("h3:1234", 10 * GB); // label = <empty>
+
+ // Submit app1 with 1Gb AM resource to Queue A1 for label X
+ MockRMAppSubmissionData data5 =
+ MockRMAppSubmissionData.Builder.createWithMemory(GB, rm1)
Review Comment:
5 chars
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]