chia7712 commented on code in PR #915:
URL: https://github.com/apache/yunikorn-core/pull/915#discussion_r1675124403
##########
pkg/scheduler/objects/allocation_ask_test.go:
##########
@@ -117,6 +117,9 @@ func TestPreemptCheckTime(t *testing.T) {
}
func TestPlaceHolder(t *testing.T) {
+ const (
Review Comment:
```go
func TestPlaceHolder(t *testing.T) {
siAsk := &si.AllocationAsk{
AllocationKey: "ask1",
ApplicationID: "app1",
PartitionName: "default",
}
ask := NewAllocationAskFromSI(siAsk)
assert.Assert(t, !ask.IsPlaceholder(), "standard ask should not be a
placeholder")
assert.Equal(t, ask.GetTaskGroup(), "", "standard ask should not have a
TaskGroupName")
siAsk = &si.AllocationAsk{
AllocationKey: "ask1",
ApplicationID: "app1",
PartitionName: "default",
TaskGroupName: "",
Placeholder: true,
}
ask = NewAllocationAskFromSI(siAsk)
var nilAsk *AllocationAsk
assert.Equal(t, ask, nilAsk, "placeholder ask created without a
TaskGroupName")
siAsk.TaskGroupName = "TestPlaceHolder"
ask = NewAllocationAskFromSI(siAsk)
assert.Assert(t, ask != nilAsk, "placeholder ask creation failed
unexpectedly")
assert.Assert(t, ask.IsPlaceholder(), "ask should have been a
placeholder")
assert.Equal(t, ask.GetTaskGroup(), siAsk.TaskGroupName, "TaskGroupName
not set as expected")
}
```
--
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]