Fix golang ci warner

This commit is contained in:
Sargun Dhillon
2020-10-04 19:48:17 -07:00
parent 946c616c67
commit 84a169f25d

View File

@@ -104,7 +104,10 @@ func TestPodEventFilter(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go tc.Run(ctx, 1)
errCh := make(chan error)
go func() {
errCh <- tc.Run(ctx, 1)
}()
ctxT, cancelT := context.WithTimeout(ctx, 30*time.Second)
defer cancelT()
@@ -115,6 +118,8 @@ func TestPodEventFilter(t *testing.T) {
case <-tc.Done():
t.Fatal(tc.Err())
case <-tc.Ready():
case err := <-errCh:
t.Fatal(err.Error())
}
pod := &corev1.Pod{}
@@ -142,6 +147,8 @@ func TestPodEventFilter(t *testing.T) {
case <-ctxT.Done():
t.Fatal(ctxT.Err())
case <-wait:
case err := <-errCh:
t.Fatal(err.Error())
}
}
}