Skip to content
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

Merged
merged 3 commits into from
Jul 7, 2020

Conversation

alcorj-mizar
Copy link
Contributor

add reclaim cases and fix placeholder nits

@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 5, 2020
    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) {
Copy link
Collaborator

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

Copy link
Contributor Author

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.

test/e2e/reclaim.go Show resolved Hide resolved
By("Create new comming queue and job")
q3 := "reclaim-q3"
ctx.queues = append(ctx.queues, q3)
createQueues(ctx)
Copy link
Collaborator

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

Copy link
Contributor Author

@alcorj-mizar alcorj-mizar Jul 6, 2020

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.


})

It("Reclaim Cases 3: New queue with job created no reclaim when job.podGroup.Status.Phase pending", func() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case 2

Copy link
Contributor Author

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.

Copy link
Contributor Author

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"

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() {
Copy link
Collaborator

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

Copy link
Contributor Author

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.

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() {
Copy link
Collaborator

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]>
@TravisBuddy
Copy link

Travis tests have failed

Hey @alcorj-mizar,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 6069e780-bf9f-11ea-8212-0f9c14daf924

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
switch state := status; state {
switch status {

return batchJob, err
}

WaitQueueStatus := func(ctx *testContext, status string, num int32, queue string) error {
Copy link
Collaborator

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


// 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(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LabelSelector: labels.Set(map[string]string{"volcano.sh/job-name": j3}).String(),
LabelSelector: labels.Set(map[string]string{batchv1alpha1.JobNameKey: j3}).String(),

@TravisBuddy
Copy link

Travis tests have failed

Hey @alcorj-mizar,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 7b04a460-c006-11ea-8f0c-c508e01afe59

    fix reclaim nits

Signed-off-by: alcorj.mizar <[email protected]>
Copy link
Collaborator

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2020
@hzxuzhonghu
Copy link
Collaborator

/lgtm

@hzxuzhonghu hzxuzhonghu added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2020
@volcano-sh-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot merged commit 7b82115 into volcano-sh:master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants