wilfred-s commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1045687200
##########
pkg/scheduler/objects/queue_test.go:
##########
@@ -1334,6 +1334,17 @@ func TestGetPartitionQueueDAOInfo(t *testing.T) {
root.guaranteedResource = getResource(t)
assert.DeepEqual(t, root.GetMaxResource().DAOMap(),
root.GetMaxResource().DAOMap())
assert.DeepEqual(t, root.GetGuaranteedResource().DAOMap(),
root.GetGuaranteedResource().DAOMap())
+
+ // test allocatingAcceptedApps
+ root.allocatingAcceptedApps = getAllocatingAcceptedApps()
+ assert.Assert(t, reflect.DeepEqual(len(root.allocatingAcceptedApps),
len(root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps)))
Review Comment:
The test is just doing a length comparison, simplify to:
assert.Equal(t, len(), len(), "missing allocating apps")
##########
pkg/scheduler/objects/queue.go:
##########
@@ -473,6 +473,9 @@ func (sq *Queue) GetPartitionQueueDAOInfo()
dao.PartitionQueueDAOInfo {
} else {
queueInfo.Parent =
sq.QueuePath[:strings.LastIndex(sq.QueuePath, configs.DOT)]
}
+ queueInfo.MaxRunningApps = sq.maxRunningApps
+ queueInfo.RunningApps = sq.runningApps
+ queueInfo.AllocatingAcceptedApps = make([]string,
len(sq.allocatingAcceptedApps))
Review Comment:
We still need the loop to copy the keys over otherwise we just have an empty
slice, this is a cleaner solution copying the keys:
```
for appID, _ := range sq.allocatingAcceptedApps {
queueInfo.AllocatingAcceptedApps =
append(queueInfo.AllocatingAcceptedApps, appID)
}
```
--
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]