manirajv06 commented on code in PR #760:
URL: https://github.com/apache/yunikorn-core/pull/760#discussion_r1442620521


##########
pkg/common/configs/configvalidator_test.go:
##########
@@ -1580,3 +1825,56 @@ func TestCheckLimits(t *testing.T) { //nolint:funlen
                })
        }
 }
+
+func TestCheckLimitMaxApplicationsGrandLevel(t *testing.T) {
+       err := checkLimitMaxApplications(
+               QueueConfig{
+                       Name: "root",
+                       Limits: []Limit{
+                               {
+                                       Limit:           "user1",
+                                       Users:           []string{"user1"},
+                                       MaxApplications: 100,
+                               },
+                               {
+                                       Limit:           "user2",
+                                       Users:           []string{"user2"},
+                                       MaxApplications: 100,
+                               },
+                       },
+                       Queues: []QueueConfig{
+                               {
+                                       Name: "parent",
+                                       Limits: []Limit{
+                                               {
+                                                       Limit:           
"user1",
+                                                       Users:           
[]string{"user1"},
+                                                       MaxApplications: 50,
+                                               },
+                                       },
+                                       Queues: []QueueConfig{
+                                               {
+                                                       Name: "child",
+                                                       Limits: []Limit{
+                                                               {
+                                                                       Limit:  
         "user1",
+                                                                       Users:  
         []string{"user1"},
+                                                                       
MaxApplications: 10,
+                                                               },
+                                                               {
+                                                                       Limit:  
         "user2",
+                                                                       Users:  
         []string{"user2"},
+                                                                       
MaxApplications: 150,
+                                                               },
+                                                       },
+                                               },
+                                       },
+                               },
+                       },
+               },
+               make(map[string]map[string]uint64),
+               make(map[string]map[string]uint64),
+               common.Empty,
+       )
+       assert.Equal(t, err != nil, true, "user2 cpu maxapplications in 
root.parent.child should not be large than root") // this will fail
+}

Review Comment:
   I think this single test case has been already covered in earlier method. 
Isn't it? Having new method just for one case can be avoided.



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