-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e: add reclaim cases and fix placeholder nits #906
Conversation
add reclaim cases and fix placeholder nits Signed-off-by: alcorj.mizar <[email protected]>
It("Reclaim: New queue with job created no reclaim when resource is enough", func() { | ||
var _ = Describe("Reclaim E2E Test", func() { | ||
|
||
CreateReclaimJob := func(ctx *testContext, req v1.ResourceList, name string, queue string, pri string) (*batchv1alpha1.Job, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this function out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is only use in reclaim, seems not suitable to move to utils.
By("Create new comming queue and job") | ||
q3 := "reclaim-q3" | ||
ctx.queues = append(ctx.queues, q3) | ||
createQueues(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will fail if create a queue that already exists unless you changed it as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change the createQueues function in previous pr, it will skip the exists queue and will not fail.
test/e2e/reclaim.go
Outdated
|
||
}) | ||
|
||
It("Reclaim Cases 3: New queue with job created no reclaim when job.podGroup.Status.Phase pending", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skip the case 2 because last time i found, we need to add priority to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe you mean "Reclaim Cases 3" => "Reclaim Case 3"
test/e2e/reclaim.go
Outdated
Expect(err).NotTo(HaveOccurred(), "Error waiting for queue pending") | ||
}) | ||
|
||
It("Reclaim Cases 4: New queue with job created no reclaim when new queue is not created", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is prevented by admission during job creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this case is list in our excel.
test/e2e/reclaim.go
Outdated
Expect(err).NotTo(HaveOccurred(), "Error waiting for queue running") | ||
}) | ||
|
||
It("Reclaim Cases 5: New queue with job created no reclaim when job or task is low-priority", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment: as we agreed, this is not intended behavior. Actually, it is a bug.
fix placeholder nits Signed-off-by: alcorj.mizar <[email protected]>
Travis tests have failedHey @alcorj-mizar, TravisBuddy Request Identifier: 6069e780-bf9f-11ea-8212-0f9c14daf924 |
test/e2e/reclaim.go
Outdated
err := waitQueueStatus(func() (bool, error) { | ||
queue, err := ctx.vcclient.SchedulingV1beta1().Queues().Get(context.TODO(), queue, metav1.GetOptions{}) | ||
Expect(err).NotTo(HaveOccurred(), "Get queue %s failed", queue) | ||
switch state := status; state { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch state := status; state { | |
switch status { |
return batchJob, err | ||
} | ||
|
||
WaitQueueStatus := func(ctx *testContext, status string, num int32, queue string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what the num
param stands for
test/e2e/reclaim.go
Outdated
|
||
// delete pod of job3 to make sure reclaim-j3 podgroup is pending | ||
listOptions := metav1.ListOptions{ | ||
LabelSelector: labels.Set(map[string]string{"volcano.sh/job-name": j3}).String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LabelSelector: labels.Set(map[string]string{"volcano.sh/job-name": j3}).String(), | |
LabelSelector: labels.Set(map[string]string{batchv1alpha1.JobNameKey: j3}).String(), |
Travis tests have failedHey @alcorj-mizar, TravisBuddy Request Identifier: 7b04a460-c006-11ea-8f0c-c508e01afe59 |
fix reclaim nits Signed-off-by: alcorj.mizar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: alcorj-mizar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
add reclaim cases and fix placeholder nits