Merge pull request #91185 from gaurav1086/fix_race_in_cacher_whitebox

Apiserver: Fix data race in cacher whitebox test
This commit is contained in:
Kubernetes Prow Robot 2020-06-03 14:40:43 -07:00 committed by GitHub
commit c18bc7e9f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -728,7 +728,7 @@ func testCacherSendBookmarkEvents(t *testing.T, allowWatchBookmarks, expectedBoo
go func() {
deadline := time.Now().Add(time.Second)
for i := 0; time.Now().Before(deadline); i++ {
err = cacher.watchCache.Add(&examplev1.Pod{
err := cacher.watchCache.Add(&examplev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("pod-%d", i),
Namespace: "ns",