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

Improve E2E tests for the gang-scheduling #1801

Merged
merged 1 commit into from
May 11, 2023

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented May 7, 2023

What this PR does / why we need it:
In E2E, after we created Jobs with unschedulable configurations, we verify the number of conditions is 1 when using scheduler plugins for gang scheduling.

But, the test seems flaky, as reported in #1779.

So, I modified the test to verify whether unschedulable Jobs have a Created condition and don't have a Running condition instead of the current way.

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
Fixes #1779

Checklist:

  • Docs included if any changes are user facing

@google-oss-prow google-oss-prow bot requested review from jinchihe and kuizhiqing May 7, 2023 15:05
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4907867447

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 39.482%

Files with Coverage Reduction New Missed Lines %
pkg/controller.v1/mpi/mpijob_controller.go 2 77.16%
Totals Coverage Status
Change from base Build 4659763896: 0.03%
Covered Lines: 2742
Relevant Lines: 6945

💛 - Coveralls

@tenzen-y
Copy link
Member Author

tenzen-y commented May 7, 2023

/assign @johnugeorge @nagar-ajay

if not client.is_job_created(name, namespace, job_kind):
raise Exception(f"{job_kind} should be in Created condition")

# Job shouldn't have a Running condition.
if client.is_job_running(name, namespace, job_kind):
Copy link
Member

Choose a reason for hiding this comment

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

Will this be flaky? What if job gets into running state?

Copy link
Member Author

Choose a reason for hiding this comment

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

In that case, the test should be failed since we pass an unschedulable job to def verify_unschedulable_job_e2e.

unschedulable_tfjob = generate_tfjob(worker, V1SchedulingPolicy(min_available=10), job_namespace)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@nagar-ajay nagar-ajay May 11, 2023

Choose a reason for hiding this comment

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

@tenzen-y Sorry for the late response.
I agree with the behavior, that if we're passing an unschedulable job and it has a running state then our test should fail.
My doubt is, are we sure that the job we're passing is unschedulable? Because in my testing the job had two states (created and running). If the job is unschedulable then it shouldn't have running state, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

My doubt is, are we sure that the job we're passing is unschedulable?

@nagar-ajay Ah, I see.

In the previous test, we verify the number of Conditions. So, If the Job has Created=true and Running=false, this test unintentionally fails.

In this PR, the test would be passed in that case (Created=true and Running=false).

Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

yup, that makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me summarize for @johnugeorge.

In the previous Implementation, tests go to fail if the Job has Created=false OR Has(Running).

In this implementation, tests go to fail only if Job has Created=false OR Running=true.

@nagar-ajay
Copy link
Contributor

Thanks for fixing the issue. The changes looks good to me.

@johnugeorge
Copy link
Member

Thanks @tenzen-y for explaining
/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label May 11, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge, tenzen-y

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

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4907867447

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 39.41%

Files with Coverage Reduction New Missed Lines %
pkg/controller.v1/mpi/mpijob_controller.go 2 77.16%
Totals Coverage Status
Change from base Build 4659763896: -0.04%
Covered Lines: 2737
Relevant Lines: 6945

💛 - Coveralls

@google-oss-prow google-oss-prow bot merged commit 485b1fb into kubeflow:master May 11, 2023
@tenzen-y tenzen-y deleted the improve-e2e-test branch May 11, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky e2e tests
4 participants