-
Notifications
You must be signed in to change notification settings - Fork 41k
test: add batch pod deletion for kubelet e2e tests #132980
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
base: master
Are you sure you want to change the base?
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @ylink-lfs. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@ylink-lfs: The label(s) In response to this:
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. |
/assign tallclair |
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.
Pull Request Overview
This PR introduces a batch deletion helper for pod cleanup in node e2e tests to streamline parallel pod removals and speed up test execution.
- Replace sequential
DeletePodWithWait
calls withDeletePodWithWaitByBatch
in node e2e test code - Add
DeletePodWithWaitByBatch
implementation in the framework with concurrent deletion logic - Update imports to include
slices
andsync
for the new helper
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
test/e2e/node/pod_resize.go | Swapped individual pod deletions for batch deletion calls |
test/e2e/node/kubelet.go | Updated AfterEach cleanup to use batch deletion |
test/e2e/framework/pod/delete.go | Added DeletePodWithWaitByBatch with concurrency support |
Comments suppressed due to low confidence (1)
test/e2e/framework/pod/delete.go:61
- The new batch deletion helper lacks unit or integration tests. Adding tests to verify parallel deletion behavior and correct error ordering would ensure this function works as expected under different conditions.
// DeletePodWithWaitByBatch deletes the passed-in pods, waits for the pod to be terminated, return deletion error if exists
7057a13
to
b11bf74
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ylink-lfs The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@ylink-lfs: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/retest |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
@@ -56,6 +57,20 @@ func DeletePodWithWait(ctx context.Context, c clientset.Interface, pod *v1.Pod) | |||
return DeletePodWithWaitByName(ctx, c, pod.GetName(), pod.GetNamespace()) | |||
} | |||
|
|||
// DeletePodWithWaitByBatch deletes the passed-in pods, waits for the pod to be terminated, return deletion error if exists | |||
func DeletePodWithWaitByBatch(ctx context.Context, c clientset.Interface, pods []*v1.Pod) { |
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.
nit: should this be named like this:
func DeletePodWithWaitByBatch(ctx context.Context, c clientset.Interface, pods []*v1.Pod) { | |
func DeletePodsWithWaitByBatch(ctx context.Context, c clientset.Interface, pods []*v1.Pod) { |
framework.ExpectNoError(DeletePodWithWait(ctx, c, pod), "Error deleting Pod %s", pod.GetName()) | ||
}(i, pod) | ||
} | ||
wg.Wait() |
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.
it may be a good improvement to fail test here instead of in each goroutine. This way test will clean up it's Pods more consistently, even if one of them failed to be deleted.
What type of PR is this?
/kind cleanup
/sig node
/sig tests
/priority backlog
What this PR does / why we need it:
e2e test simplicity and speedup purpose
Which issue(s) this PR is related to:
Clean up e2e pods in parallel #132974
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: