Skip to content

test: Add test case for createNodesOp #131607

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

Conversation

utam0k
Copy link
Member

@utam0k utam0k commented May 5, 2025

What type of PR is this?

/kind cleanup
/sig scheduling

What this PR does / why we need it:

To enhance scheduler_perf testing

Which issue(s) this PR fixes:

A part of #127745

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 5, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 5, 2025
@k8s-ci-robot k8s-ci-robot requested review from kerthcet and macsko May 5, 2025 12:56
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels May 5, 2025
Comment on lines 33 to 53
name: "Zero Nodes",
nodeCount: 0,
Copy link
Member Author

@utam0k utam0k May 5, 2025

Choose a reason for hiding this comment

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

Should this be an error in the validation? If so, I'll create the issue and fix it after merging this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, 0 on count doesn't make sense, which could be checked at a validation phase.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've created the issue and will try it after merging this pr.
#131828

@utam0k utam0k force-pushed the test-nodes-with-node-allocatable-strategy branch from 93c541b to c487678 Compare May 5, 2025 22:39
@utam0k
Copy link
Member Author

utam0k commented May 6, 2025

/cc @macsko @sanposhiho

@k8s-ci-robot k8s-ci-robot requested a review from sanposhiho May 6, 2025 02:54
@utam0k utam0k force-pushed the test-nodes-with-node-allocatable-strategy branch from c487678 to 35eceae Compare May 6, 2025 03:48
@utam0k utam0k requested a review from sanposhiho May 6, 2025 12:50
@utam0k utam0k force-pushed the test-nodes-with-node-allocatable-strategy branch from b63e59f to 4f965bc Compare May 8, 2025 12:59
@utam0k utam0k changed the title test: Add test case for runCreateNodesOp test: Add test case for createNodesOp May 8, 2025
@utam0k utam0k force-pushed the test-nodes-with-node-allocatable-strategy branch from 4f965bc to b30c176 Compare May 9, 2025 12:36
@utam0k
Copy link
Member Author

utam0k commented May 9, 2025

/retest-required

@utam0k utam0k force-pushed the test-nodes-with-node-allocatable-strategy branch 2 times, most recently from 17fca56 to 00eb343 Compare May 11, 2025 12:36
@utam0k utam0k requested a review from sanposhiho May 11, 2025 12:36
Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

nice, lookin' a lot better

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

only nits

@utam0k utam0k requested review from sanposhiho and macsko June 2, 2025 07:53
Comment on lines 892 to 894
if newNode.Status.Allocatable == nil {
newNode.Status.Allocatable = make(v1.ResourceList)
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right to question this. In production, kubelet always initializes Allocatable, but test nodes might not have it set.
Would you prefer if I add a comment explaining this, or should we enforce that test templates always include Allocatable?

Without this nil check, the test TestRunOp/Create_Nodes_with_Node_Allocatable_Strategy fails with:

  panic: assignment to entry in nil map
      at test/utils/runners.go:893 in NodeAllocatableStrategy.PreparePatch

Copy link
Member

Choose a reason for hiding this comment

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

Could you try just initializing Allocatable in makeBaseNode?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. Updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

@macsko PTAL 🙏

@utam0k utam0k requested a review from macsko June 9, 2025 12:33
@macsko
Copy link
Member

macsko commented Jun 11, 2025

/test pull-kubernetes-scheduler-perf

@utam0k utam0k force-pushed the test-nodes-with-node-allocatable-strategy branch from 7c89a7d to 174d424 Compare June 11, 2025 07:57
@utam0k
Copy link
Member Author

utam0k commented Jun 11, 2025

/test pull-kubernetes-scheduler-perf

@utam0k utam0k requested a review from macsko June 11, 2025 07:58
@utam0k
Copy link
Member Author

utam0k commented Jun 11, 2025

@macsko This PR has passedpull-kubernetes-scheduler-perf test 🎉

@utam0k utam0k force-pushed the test-nodes-with-node-allocatable-strategy branch from 174d424 to 57d55fb Compare June 11, 2025 12:29
@utam0k
Copy link
Member Author

utam0k commented Jun 11, 2025

/test pull-kubernetes-scheduler-perf

@utam0k utam0k requested a review from macsko June 11, 2025 12:29
@macsko
Copy link
Member

macsko commented Jun 11, 2025

/approve

Leaving final stamp to @sanposhiho

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2025
@utam0k
Copy link
Member Author

utam0k commented Jun 11, 2025

@macsko Thanks for your review 🙏

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

/lgtm

Lovely, thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 11, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 3447806cc240e8d7d25034654dee8ef785634a38

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: macsko, sanposhiho, utam0k

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

@k8s-ci-robot k8s-ci-robot merged commit 05592c3 into kubernetes:master Jun 11, 2025
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.34 milestone Jun 11, 2025
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. area/test 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

5 participants