manirajv06 commented on code in PR #735:
URL: https://github.com/apache/yunikorn-k8shim/pull/735#discussion_r1415078626


##########
test/e2e/user_group_limit/user_group_limit_test.go:
##########
@@ -460,24 +491,14 @@ var _ = ginkgo.Describe("UserGroupLimit", func() {
                        })
                })
 
-               // usergroup1 can deploy 2 sleep pods to root.sandbox1
-               usergroup1 := &si.UserGroupInformation{User: user1, Groups: 
[]string{group1}}
-               usergroup1Sandbox1Pod1 := deploySleepPod(usergroup1, 
"root.sandbox1", true, "because usage is less than user entry limit")
-               usergroup1Sandbox1Pod2 := deploySleepPod(usergroup1, 
"root.sandbox1", true, "because usage is equal to user entry limit")
-               checkUsage(userTestType, user1, "root.sandbox1", 
[]*v1.Pod{usergroup1Sandbox1Pod1, usergroup1Sandbox1Pod2})
-
-               // usergroup2 can deploy 1 sleep pod to root.sandbox1
-               usergroup2 := &si.UserGroupInformation{User: user2, Groups: 
[]string{group2}}
-               usergroup2Sandbox1Pod1 := deploySleepPod(usergroup2, 
"root.sandbox1", true, "because usage is less than wildcard user entry limit")
-
-               // usergroup2 can't deploy the second sleep pod to root.sandbox1
-               deploySleepPod(usergroup2, "root.sandbox1", false, "because 
final application count is more than wildcard maxapplications")
-               checkUsage(userTestType, user2, "root.sandbox1", 
[]*v1.Pod{usergroup2Sandbox1Pod1})
+               usergroup1Sandbox1Pod1 = deploySleepPod(usergroup1, 
"root.sandbox1", true, "because memory usage is less than maxresources")
+               checkUsage(userTestType, user1, "root.sandbox1", 
[]*v1.Pod{usergroup1Sandbox1Pod1})
        })
 
-       ginkgo.It("Verify_maxresources_with_a_wildcard_group_limit", func() {
+       ginkgo.It("Verify_maxapplications_with_users_limits_changed", func() {

Review Comment:
   groups ?



##########
test/e2e/user_group_limit/user_group_limit_test.go:
##########
@@ -488,44 +509,82 @@ var _ = ginkgo.Describe("UserGroupLimit", func() {
                                        Name: "sandbox1",
                                        Limits: []configs.Limit{
                                                {
-                                                       Limit:           "group 
entry",
+                                                       Limit:           "user 
entry",
                                                        Groups:          
[]string{group1},
-                                                       MaxApplications: 2,
+                                                       MaxApplications: 1,
                                                        MaxResources: 
map[string]string{
                                                                
siCommon.Memory: fmt.Sprintf("%dM", largeMem),
                                                        },
                                                },
+                                       },
+                               })
+                       })
+               })
+
+               usergroup1 := &si.UserGroupInformation{User: user1, Groups: 
[]string{group1}}
+               // usergroup1 can deploy the second sleep pod to root.sandbox1
+               usergroup1Sandbox1Pod1 := deploySleepPod(usergroup1, 
"root.sandbox1", true, "because applications is less than applications")
+               _ = deploySleepPod(usergroup1, "root.sandbox1", false, "because 
final applications is more than applications")
+               checkUsage(userTestType, user1, "root.sandbox1", 
[]*v1.Pod{usergroup1Sandbox1Pod1})
+
+               // The wait wrapper still can't fully guarantee that the config 
in AdmissionController has been updated.
+               
yunikorn.WaitForAdmissionControllerRefreshConfAfterAction(func() {
+                       
yunikorn.UpdateCustomConfigMapWrapperWithMap(oldConfigMap, "", annotation, 
admissionCustomConfig, func(sc *configs.SchedulerConfig) error {
+                               // remove placement rules so we can control 
queue
+                               sc.Partitions[0].PlacementRules = nil
+
+                               return common.AddQueue(sc, "default", "root", 
configs.QueueConfig{
+                                       Name: "sandbox1",
+                                       Limits: []configs.Limit{
                                                {
-                                                       Limit:           
"wildcard group entry",
-                                                       Groups:          
[]string{"*"},
+                                                       Limit:           "user 
entry",
+                                                       Groups:          
[]string{group1},
                                                        MaxApplications: 2,
                                                        MaxResources: 
map[string]string{
-                                                               
siCommon.Memory: fmt.Sprintf("%dM", mediumMem),
+                                                               
siCommon.Memory: fmt.Sprintf("%dM", largeMem),
                                                        },
                                                },
                                        },
                                })
                        })
                })
 
-               // usergroup1 can deploy 2 sleep pods to root.sandbox1
-               usergroup1 := &si.UserGroupInformation{User: user1, Groups: 
[]string{group1}}
-               usergroup1Sandbox1Pod1 := deploySleepPod(usergroup1, 
"root.sandbox1", true, "because usage is less than user entry limit")
-               usergroup1Sandbox1Pod2 := deploySleepPod(usergroup1, 
"root.sandbox1", true, "because usage is equal to user entry limit")
-               checkUsage(userTestType, user1, "root.sandbox1", 
[]*v1.Pod{usergroup1Sandbox1Pod1, usergroup1Sandbox1Pod2})
-
-               // usergroup2 can deploy 1 sleep pod to root.sandbox1
-               usergroup2 := &si.UserGroupInformation{User: user2, Groups: 
[]string{group2}}
-               usergroup2Sandbox1Pod1 := deploySleepPod(usergroup2, 
"root.sandbox1", true, "because usage is less than wildcard user entry limit")
-
-               // usergroup2 can't deploy the second sleep pod to root.sandbox1
-               deploySleepPod(usergroup2, "root.sandbox1", false, "because 
final memory usage is more than wildcard maxresources")
-               checkUsage(userTestType, user2, "root.sandbox1", 
[]*v1.Pod{usergroup2Sandbox1Pod1})
+               usergroup1Sandbox1Pod1 = deploySleepPod(usergroup1, 
"root.sandbox1", true, "because applications is less than new maxapplications")
+               checkUsage(userTestType, user1, "root.sandbox1", 
[]*v1.Pod{usergroup1Sandbox1Pod1})
        })
 
-       ginkgo.It("Verify_maxapplications_with_a_wildcard_group_limit", func() {
+       ginkgo.It("Verify_resources_with_groups_limits_changed", func() {

Review Comment:
   maxresources?



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