Unverified Commit 1e95c7f8 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #52640 from mYmNeo/ut

Automatic merge from submit-queue (batch tested with PRs 60346, 60135, 60289, 59643, 52640). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Correct TestUpdatePod comment Signed-off-by: 's avatarmYmNeo <thomassong2012@gmail.com> **What this PR does / why we need it**: Correct TestUpdatePod comment **Which issue this PR fixes** The original one wants to check whether all updates has been caught by podWorker, but podWorker can guarantee only the first event and the last one will processed. Correct the comment if others misunderstand the unit test.
parents 531f63c1 e74cabe5
...@@ -128,7 +128,6 @@ func drainWorkers(podWorkers *podWorkers, numPods int) { ...@@ -128,7 +128,6 @@ func drainWorkers(podWorkers *podWorkers, numPods int) {
func TestUpdatePod(t *testing.T) { func TestUpdatePod(t *testing.T) {
podWorkers, processed := createPodWorkers() podWorkers, processed := createPodWorkers()
// Check whether all pod updates will be processed.
numPods := 20 numPods := 20
for i := 0; i < numPods; i++ { for i := 0; i < numPods; i++ {
for j := i; j < numPods; j++ { for j := i; j < numPods; j++ {
...@@ -151,6 +150,7 @@ func TestUpdatePod(t *testing.T) { ...@@ -151,6 +150,7 @@ func TestUpdatePod(t *testing.T) {
continue continue
} }
// PodWorker guarantees the first and the last event will be processed
first := 0 first := 0
last := len(processed[uid]) - 1 last := len(processed[uid]) - 1
if processed[uid][first].name != string(0) { if processed[uid][first].name != string(0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment