|
@@ -338,6 +338,36 @@ public class TestCapacitySchedulerWeightMode {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * This test ensures that while iterating through a parent's Node Labels
|
|
|
+ * (when calculating the normalized weights) the parent's Node Labels won't
|
|
|
+ * be added to the children with weight -1. If the parent
|
|
|
+ * has a node label that a specific child doesn't the normalized calling the
|
|
|
+ * normalized weight setter will be skipped. The queue root.b has access to
|
|
|
+ * the labels "x" and "y", but root.b.b1 won't. For more information see
|
|
|
+ * YARN-10807.
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Test
|
|
|
+ public void testChildAccessibleNodeLabelsWeightMode() throws Exception {
|
|
|
+ MockRM rm = new MockRM(getCSConfWithQueueLabelsWeightOnly(conf));
|
|
|
+ rm.start();
|
|
|
+
|
|
|
+ CapacityScheduler cs =
|
|
|
+ (CapacityScheduler) rm.getRMContext().getScheduler();
|
|
|
+ LeafQueue b1 = (LeafQueue) cs.getQueue(B1);
|
|
|
+
|
|
|
+ Assert.assertNotNull(b1);
|
|
|
+ Assert.assertTrue(b1.getAccessibleNodeLabels().isEmpty());
|
|
|
+
|
|
|
+ Set<String> b1ExistingNodeLabels = ((CSQueue) b1).getQueueCapacities()
|
|
|
+ .getExistingNodeLabels();
|
|
|
+ Assert.assertEquals(1, b1ExistingNodeLabels.size());
|
|
|
+ Assert.assertEquals("", b1ExistingNodeLabels.iterator().next());
|
|
|
+
|
|
|
+ rm.close();
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testQueueInfoWeight() throws Exception {
|
|
|
MockRM rm = new MockRM(conf);
|