Fix data race in cacher whitebox test

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
This commit is contained in:
Gaurav Singh 2020-05-17 17:51:49 -04:00
parent ec0eec68b2
commit 3dc7098cae

View File

@ -681,7 +681,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",