kingamarton commented on a change in pull request #227:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/227#discussion_r539224548
##########
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:
Please check that the error is nil. Also lint will report an issue for
this line I think.
----------------------------------------------------------------
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:
[email protected]