wilfred-s commented on code in PR #696:
URL: https://github.com/apache/yunikorn-core/pull/696#discussion_r1400024239


##########
pkg/scheduler/objects/queue_test.go:
##########
@@ -2214,23 +2214,18 @@ func TestNewConfiguredQueue(t *testing.T) {
        assert.Assert(t, resources.Equals(resourceStruct, 
parent.template.GetMaxResource()))
        assert.Assert(t, resources.Equals(resourceStruct, 
parent.template.GetGuaranteedResource()))
 
-       // case 0: leaf can use template
+       // case 0: managed leaf queue can't use template
        leafConfig := configs.QueueConfig{
-               Name:       "leaf_queue",
-               Parent:     false,
-               Properties: getProperties(),
-               Resources: configs.Resources{
-                       Max:        getResourceConf(),
-                       Guaranteed: getResourceConf(),
-               },
+               Name:   "leaf_queue",
+               Parent: false,
        }
        childLeaf, err := NewConfiguredQueue(leafConfig, parent)
        assert.NilError(t, err, "failed to create queue: %v", err)
        assert.Equal(t, childLeaf.QueuePath, "parent_queue.leaf_queue")
        assert.Assert(t, childLeaf.template == nil)
-       assert.DeepEqual(t, childLeaf.properties, 
parent.template.GetProperties())
-       assert.Assert(t, resources.Equals(childLeaf.maxResource, 
parent.template.GetMaxResource()))
-       assert.Assert(t, resources.Equals(childLeaf.guaranteedResource, 
parent.template.GetGuaranteedResource()))
+       assert.Assert(t, !reflect.DeepEqual(childLeaf.properties, 
parent.template.GetProperties()))
+       assert.Assert(t, !resources.Equals(childLeaf.maxResource, 
parent.template.GetMaxResource()))
+       assert.Assert(t, !resources.Equals(childLeaf.guaranteedResource, 
parent.template.GetGuaranteedResource()))

Review Comment:
   Since you have removed setting of the properties and the resources the check 
is now irrelevant and the two test cases really could use the same checks 
(compare to nil)
   You need to leave the child as is, resources defined, and make sure there is 
no override.
   
   compare `resources.NewResourceFromConf(leafConfig.Resources.Max)` to 
`childLeaf.maxResource` etc 



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

Reply via email to