You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/12/10 01:52:56 UTC

[GitHub] [incubator-yunikorn-core] wilfred-s commented on a change in pull request #227: [YUNIKORN-480] root queue max resource update

wilfred-s commented on a change in pull request #227:
URL: https://github.com/apache/incubator-yunikorn-core/pull/227#discussion_r539783000



##########
File path: pkg/scheduler/partition_test.go
##########
@@ -1042,3 +1042,39 @@ func TestScheduleRemoveReservedAsk(t *testing.T) {
 	assert.Equal(t, len(partition.reservedApps), 1, "partition should still have reserved app")
 	assert.Equal(t, len(app.GetReservations()), 1, "application reservations should be kept at 1")
 }
+
+// update the config with nodes registered and make sure that the root max and guaranteed are not changed
+func TestUpdateRootQueue(t *testing.T) {
+	partition := createQueuesNodes(t)
+	if partition == nil {
+		t.Fatal("partition create failed")
+	}
+	res, err := resources.NewResourceFromConf(map[string]string{"first": "20"})
+	assert.NilError(t, err, "resource creation failed")
+	assert.Assert(t, resources.Equals(res, partition.totalPartitionResource), "partition resource not set as expected")
+	assert.Assert(t, resources.Equals(res, partition.root.GetMaxResource()), "root max resource not set as expected")
+
+	conf := configs.PartitionConfig{
+		Name: "test",
+		Queues: []configs.QueueConfig{
+			{
+				Name:      "root",
+				Parent:    true,
+				SubmitACL: "*",
+				Queues:    nil,
+			},
+		},
+		PlacementRules: nil,
+		Limits:         nil,
+		Preemption:     configs.PartitionPreemptionConfig{},
+		NodeSortPolicy: configs.NodeSortingPolicy{},
+	}
+
+	err = partition.updatePartitionDetails(conf)

Review comment:
       added the missing assert




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org