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: mYmNeo <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.
This commit is contained in:
Kubernetes Submit Queue 2018-02-24 23:40:01 -08:00 committed by GitHub
commit 1e95c7f856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,6 @@ func drainWorkers(podWorkers *podWorkers, numPods int) {
func TestUpdatePod(t *testing.T) {
podWorkers, processed := createPodWorkers()
// Check whether all pod updates will be processed.
numPods := 20
for i := 0; i < numPods; i++ {
for j := i; j < numPods; j++ {
@ -151,6 +150,7 @@ func TestUpdatePod(t *testing.T) {
continue
}
// PodWorker guarantees the first and the last event will be processed
first := 0
last := len(processed[uid]) - 1
if processed[uid][first].name != string(0) {