{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25188","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25188/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25188/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25188/events","html_url":"https://github.com/kubernetes/kubernetes/pull/25188","id":153184192,"number":25188,"title":"Make fake event recorder thread safe.","user":{"login":"jsafrane","id":1745006,"avatar_url":"https://avatars.githubusercontent.com/u/1745006?v=3","gravatar_id":"","url":"https://api.github.com/users/jsafrane","html_url":"https://github.com/jsafrane","followers_url":"https://api.github.com/users/jsafrane/followers","following_url":"https://api.github.com/users/jsafrane/following{/other_user}","gists_url":"https://api.github.com/users/jsafrane/gists{/gist_id}","starred_url":"https://api.github.com/users/jsafrane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsafrane/subscriptions","organizations_url":"https://api.github.com/users/jsafrane/orgs","repos_url":"https://api.github.com/users/jsafrane/repos","events_url":"https://api.github.com/users/jsafrane/events{/privacy}","received_events_url":"https://api.github.com/users/jsafrane/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/S","name":"size/S","color":"77bb00"}],"state":"open","locked":false,"assignee":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-05-05T07:40:53Z","updated_at":"2016-05-06T08:49:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/25188","html_url":"https://github.com/kubernetes/kubernetes/pull/25188","diff_url":"https://github.com/kubernetes/kubernetes/pull/25188.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/25188.patch"},"body":"I get frequent data race reports when unit testing my code because the event recorder is not thread safe.\r\n\r\nI have a controller that starts a goroutine for potentially long operation. When the operation fails it emits an event to tell user that something went wrong. Now, my unit test pokes the controller with buggy data and expects that the event is emitted in the end. When I check that the event was recorded I get race with the goroutine emitting this event, as we both read/write `FakeRecorder.Events`. I don't have any locks in my goroutine and I do not want to add some just because of event recorder.\r\n\r\nIt seems that I am the first ever to read `FakeRecorder.Events`! So I made it private and added extra method to read it.\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/217387599","html_url":"https://github.com/kubernetes/kubernetes/pull/25188#issuecomment-217387599","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25188","id":217387599,"user":{"login":"k8s-bot","id":12551979,"avatar_url":"https://avatars.githubusercontent.com/u/12551979?v=3","gravatar_id":"","url":"https://api.github.com/users/k8s-bot","html_url":"https://github.com/k8s-bot","followers_url":"https://api.github.com/users/k8s-bot/followers","following_url":"https://api.github.com/users/k8s-bot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-bot/subscriptions","organizations_url":"https://api.github.com/users/k8s-bot/orgs","repos_url":"https://api.github.com/users/k8s-bot/repos","events_url":"https://api.github.com/users/k8s-bot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-bot/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T08:49:27Z","updated_at":"2016-05-06T08:49:27Z","body":"GCE e2e build/test **passed** for commit f4abfb2a0c4879f1d80945409df2153a06dfda7e.\n* [Build Log](http://pr-test.k8s.io/25188/kubernetes-pull-build-test-e2e-gce/38722/build-log.txt)\n* [Test Artifacts](https://console.developers.google.com/storage/browser/kubernetes-jenkins/pr-logs/pull/25188/kubernetes-pull-build-test-e2e-gce/38722/artifacts/)\n* [Internal Jenkins Results](http://goto.google.com/prkubekins/job/kubernetes-pull-build-test-e2e-gce//38722)\n"}}