Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankert01 committed Dec 28, 2024
1 parent 593469d commit 02895df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/scheduler/ugm/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)
Expand Down

0 comments on commit 02895df

Please sign in to comment.