Repository: kubernetes
Issue: data race in priority and fairness unit test
Labels: kind/bug,sig/api-machinery,triage/accepted

### What happened?

`TestApfWatchHandlePanic/post-execute_panic` has a data race

```
{Failed  === RUN   TestApfWatchHandlePanic/post-execute_panic
==================
WARNING: DATA RACE
Read at 0x000003a22108 by goroutine 426:
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.newApfHandlerWithFilter.func2()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go:179 +0x584
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2084 +0x4d
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithRequestInfo.func1()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters/requestinfo.go:39 +0x547
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2084 +0x4d
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.TestApfWatchHandlePanic.func3.1()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go:598 +0xd0
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2084 +0x4d
  net/http.serverHandler.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2916 +0x896
  net/http.(*conn).serve()
      /usr/local/go/src/net/http/server.go:1966 +0xbaa
  net/http.(*Server).Serve.func3()
      /usr/local/go/src/net/http/server.go:3071 +0x58

Previous write at 0x000003a22108 by goroutine 166:
  sync/atomic.AddInt32()
      /usr/local/go/src/runtime/race_amd64.s:279 +0xb
  sync/atomic.AddInt32()
      <autogenerated>:1 +0x1a
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.WithPriorityAndFairness.func1.7.2()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go:204 +0x3e
  runtime.deferreturn()
      /usr/local/go/src/runtime/panic.go:436 +0x32
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.(*fakeWatchApfFilter).Handle()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go:415 +0xa6
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.WithPriorityAndFairness.func1.8()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go:260 +0x1a4

Goroutine 426 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/go/src/net/http/server.go:3071 +0x80c
  net/http/httptest.(*Server).goServe.func1()
      /usr/local/go/src/net/http/httptest/server.go:308 +0xb2

Goroutine 166 (finished) created at:
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.WithPriorityAndFairness.func1()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go:228 +0xea5
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2084 +0x4d
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.newApfHandlerWithFilter.func2()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go:177 +0x56c
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2084 +0x4d
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithRequestInfo.func1()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters/requestinfo.go:39 +0x547
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2084 +0x4d
  k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.TestApfWatchPanic.func3()
      /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go:553 +0xd0
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2084 +0x4d
  net/http.serverHandler.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2916 +0x896
  net/http.(*conn).serve()
      /usr/local/go/src/net/http/server.go:1966 +0xbaa
  net/http.(*Server).Serve.func3()
      /usr/local/go/src/net/http/server.go:3071 +0x58
==================
    priority-and-fairness_test.go:180: Wanted 0 requests executing, got 1
    priority-and-fairness_test.go:595: expected panic, got <nil>
    testing.go:1312: race detected during execution of test
    --- FAIL: TestApfWatchHandlePanic/post-execute_panic (5.05s)
}
```

https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/110132/pull-kubernetes-unit/1527377549582143488

### What did you expect to happen?

test should not have data race

### How can we reproduce it (as minimally and precisely as possible)?

https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/110132/pull-kubernetes-unit/1527377549582143488