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

TAS: add e2e tests for rank ordering for Job #3584

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

mimowo
Copy link
Contributor

@mimowo mimowo commented Nov 18, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

Part of #3450
Part of #3533

Special notes for your reviewer:

  • I was also thinking about an alternative assert that rack(pod0)==rack(pod1) and rack(pod2)==rack(pod3), but I think it will be harder to debug when the assert fails. With the exact assignment check we can easily see the full assignment.
  • I have confirmed locally that when not using TAS the distributions of pods is completely random (I commented out setting the TopologyName and TAS PodSet annotation), then got:
  [FAILED] Expected object to be comparable, diff:   map[string]string{
  - 	"0": "kind-worker",
  + 	"0": "kind-worker5",
  - 	"1": "kind-worker2",
  + 	"1": "kind-worker7",
    	"2": "kind-worker3",
    	"3": "kind-worker4",
    }

I ran it a 4 times and it failed all repeats.

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 18, 2024
@mimowo mimowo changed the title TAS: add e2e tests for rank ordering for Job WIP TAS: add e2e tests for rank ordering for Job Nov 18, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Nov 18, 2024
Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 985b955
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/673b81cb9fcc4c000804500c

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 18, 2024
@mimowo mimowo force-pushed the tas-rank-ordering-job-e2e branch 4 times, most recently from 9dab065 to 9168e65 Compare November 18, 2024 17:19
@mimowo mimowo changed the title WIP TAS: add e2e tests for rank ordering for Job TAS: add e2e tests for rank ordering for Job Nov 18, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2024
@mimowo
Copy link
Contributor Author

mimowo commented Nov 18, 2024

/assign @PBundyra
cc @tenzen-y

@mimowo
Copy link
Contributor Author

mimowo commented Nov 18, 2024

/test pull-kueue-test-tas-e2e-main

@PBundyra
Copy link
Contributor

LGTM, good job! I'll hold for @tenzen-y to take a look
/hold
/lgtm

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 18, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d52ed29323337d92ac431c26372b19e1b6982709

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Thanks!
/lgtm
/approve

I was also thinking about an alternative assert that rack(pod0)==rack(pod1) and rack(pod2)==rack(pod3), but I think it will be harder to debug when the assert fails. With the exact assignment check we can easily see the full assignment.

Do we have integration testing for this situation? I guess that we can easily simulate this situation in the case of integration-testing.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mimowo, 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

@tenzen-y
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 19, 2024
@mimowo
Copy link
Contributor Author

mimowo commented Nov 19, 2024

Do we have integration testing for this situation?

no, but we have unit testing which is quite useful here, because it is relatively high-level (for the exported function), which makes it similar to TestSchedule which proved to be very useful over time.

So, personally I'm using unit tests for debugging, the e2e tests are useful to confirm the feature works.

I considered adding integration tests, but they are actually tricky, because TopologyUngater operates on pods, but we don't enable the k8s Job controller in the integaration tests (no kube-controller-manager, only API server). So, we would need to create the pods ourselves, just like in unit tests, so I don't see much gain.

@k8s-ci-robot k8s-ci-robot merged commit ec42d93 into kubernetes-sigs:main Nov 19, 2024
16 of 17 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.10 milestone Nov 19, 2024
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants