diff --git a/pkg/scheduler/ugm/manager_test.go b/pkg/scheduler/ugm/manager_test.go index 210e960a2..310295771 100644 --- a/pkg/scheduler/ugm/manager_test.go +++ b/pkg/scheduler/ugm/manager_test.go @@ -695,6 +695,7 @@ func TestDecreaseTrackedResourceForGroupTracker(t *testing.T) { setupUGM() // Queue setup: // root->parent + // case 1: DecreaseTrackedResource with specified config limits user := security.UserGroup{User: "user1", Groups: []string{"group1"}} conf := createConfigWithoutLimits() conf.Queues[0].Queues[0].Limits = []configs.Limit{ @@ -720,21 +721,20 @@ func TestDecreaseTrackedResourceForGroupTracker(t *testing.T) { assert.Equal(t, resources.Equals(groupTracker.queueTracker.childQueueTrackers["parent"].resourceUsage, usage), true) manager.DecreaseTrackedResource("root.parent", TestApp1, usage, user, true) - groupTracker = m.GetGroupTracker(user.Groups[0]) assert.Equal(t, groupTracker != nil, true) assert.Equal(t, groupTracker.queueTracker.childQueueTrackers["parent"].runningApplications[TestApp1], false) assert.Equal(t, resources.Equals(groupTracker.queueTracker.childQueueTrackers["parent"].resourceUsage, resources.Zero), true) + // case 2: DecreaseTrackedResource with nil config limits + conf.Queues[0].Queues[0].Limits = nil + assert.NilError(t, manager.UpdateConfig(conf.Queues[0], "root")) manager.IncreaseTrackedResource("root.parent", TestApp1, usage, user) groupTracker = m.GetGroupTracker(user.Groups[0]) assert.Equal(t, groupTracker != nil, true) assert.Equal(t, groupTracker.queueTracker.childQueueTrackers["parent"].runningApplications[TestApp1], true) assert.Equal(t, resources.Equals(groupTracker.queueTracker.childQueueTrackers["parent"].resourceUsage, usage), true) - conf.Queues[0].Queues[0].Limits = nil - assert.NilError(t, manager.UpdateConfig(conf.Queues[0], "root")) - manager.DecreaseTrackedResource("root.parent", TestApp1, usage, user, true) groupTracker = m.GetGroupTracker(user.Groups[0]) assert.Equal(t, groupTracker == nil, true)