pbacsko commented on code in PR #522:
URL: https://github.com/apache/yunikorn-core/pull/522#discussion_r1150366193
##########
pkg/scheduler/ugm/group_tracker_test.go:
##########
@@ -132,13 +132,23 @@ func TestGTDecreaseTrackedResource(t *testing.T) {
assert.Equal(t, "map[mem:60000000 vcore:60000]",
actualResources1["root.parent.child1"].String(), "wrong resource")
assert.Equal(t, "map[mem:10000000 vcore:10000]",
actualResources1["root.parent.child2"].String(), "wrong resource")
- err = groupTracker.decreaseTrackedResource(queuePath1, TestApp1,
usage1, true)
+ usage4, err := resources.NewResourceFromConf(map[string]string{"mem":
"60M", "vcore": "60"})
+ if err != nil {
+ t.Errorf("new resource create returned error or wrong resource:
error %t, res %v", err, usage3)
+ }
+
+ err = groupTracker.decreaseTrackedResource(queuePath1, TestApp1,
usage4, true)
if err != nil {
t.Fatalf("unable to decrease tracked resource: queuepath %s,
app %s, res %v, error %t", queuePath1, TestApp1, usage1, err)
}
assert.Equal(t, 1, len(groupTracker.getTrackedApplications()))
- err = groupTracker.decreaseTrackedResource(queuePath2, TestApp2,
usage2, true)
+ usage5, err := resources.NewResourceFromConf(map[string]string{"mem":
"10M", "vcore": "10"})
+ if err != nil {
+ t.Errorf("new resource create returned error or wrong resource:
error %t, res %v", err, usage3)
+ }
+
+ err = groupTracker.decreaseTrackedResource(queuePath2, TestApp2,
usage5, true)
Review Comment:
We need tests for:
1) Leaf reaches zero, check that it gets removed
2) Set resources of parent to zero while still having leaf trackers to see
that Error object is returned
--
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]