{"action":"created","comment":{"url":"https://api.github.com/repos/knative/pkg/pulls/comments/268385476","pull_request_review_id":218029530,"id":268385476,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2ODM4NTQ3Ng==","diff_hunk":"@@ -625,3 +630,67 @@ func checkStats(t *testing.T, r *FakeStatsReporter, reportCount, lastQueueDepth,\n \t\tt.Errorf(\"Reconcile success = %v, wanted %v\", got, want)\n \t}\n }\n+\n+type FixedInformer struct {\n+\tsunk bool\n+}\n+\n+var _ Informer = (*FixedInformer)(nil)\n+\n+func (fi *FixedInformer) Run(<-chan struct{}) {}\n+func (fi *FixedInformer) HasSynced() bool {\n+\treturn fi.sunk\n+}\n+\n+func TestStartInformersSuccess(t *testing.T) {\n+\terrCh := make(chan error)\n+\tdefer close(errCh)\n+\n+\tfi := &FixedInformer{sunk: true}\n+\n+\tstopCh := make(chan struct{})\n+\tdefer close(stopCh)\n+\tgo func() {\n+\t\terrCh <- StartInformers(stopCh, fi)\n+\t}()\n+\n+\tselect {\n+\tcase err := <-errCh:\n+\t\tif err != nil {\n+\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n+\t\t}\n+\tcase <-time.After(1 * time.Second):\n+\t\tt.Error(\"Timed out waiting for informers to sync.\")\n+\t}\n+}\n+\n+func TestStartInformersFailure(t *testing.T) {\n+\terrCh := make(chan error)\n+\tdefer close(errCh)\n+\n+\tfi := &FixedInformer{sunk: false}\n+\n+\tstopCh := make(chan struct{})\n+\tgo func() {\n+\t\terrCh <- StartInformers(stopCh, fi)\n+\t}()\n+\n+\tselect {\n+\tcase err := <-errCh:\n+\t\tt.Errorf(\"Unexpected send on errCh: %v\", err)\n+\tcase <-time.After(1 * time.Second):\n+\t\t// Wait a brief period to ensure nothing is sent.\n+\t}\n+","path":"controller/controller_test.go","position":105,"original_position":105,"commit_id":"31fe27bfa741d26194a7e7ebd5d089b2eadd5afa","original_commit_id":"31fe27bfa741d26194a7e7ebd5d089b2eadd5afa","user":{"login":"vagababov","id":764767,"node_id":"MDQ6VXNlcjc2NDc2Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/764767?v=4","gravatar_id":"","url":"https://api.github.com/users/vagababov","html_url":"https://github.com/vagababov","followers_url":"https://api.github.com/users/vagababov/followers","following_url":"https://api.github.com/users/vagababov/following{/other_user}","gists_url":"https://api.github.com/users/vagababov/gists{/gist_id}","starred_url":"https://api.github.com/users/vagababov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vagababov/subscriptions","organizations_url":"https://api.github.com/users/vagababov/orgs","repos_url":"https://api.github.com/users/vagababov/repos","events_url":"https://api.github.com/users/vagababov/events{/privacy}","received_events_url":"https://api.github.com/users/vagababov/received_events","type":"User","site_admin":false},"body":"Do we want a test, were sunk goes from false -> true? ⬛️ ","created_at":"2019-03-23T07:23:11Z","updated_at":"2019-03-23T07:23:29Z","html_url":"https://github.com/knative/pkg/pull/335#discussion_r268385476","pull_request_url":"https://api.github.com/repos/knative/pkg/pulls/335","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/knative/pkg/pulls/comments/268385476"},"html":{"href":"https://github.com/knative/pkg/pull/335#discussion_r268385476"},"pull_request":{"href":"https://api.github.com/repos/knative/pkg/pulls/335"}}},"pull_request":{"url":"https://api.github.com/repos/knative/pkg/pulls/335","id":263812150,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYzODEyMTUw","html_url":"https://github.com/knative/pkg/pull/335","diff_url":"https://github.com/knative/pkg/pull/335.diff","patch_url":"https://github.com/knative/pkg/pull/335.patch","issue_url":"https://api.github.com/repos/knative/pkg/issues/335","number":335,"state":"open","locked":false,"title":"Add some helpers to reduce boilerplate in controller binaries.","user":{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false},"body":"You can see the reduction in [this PR](https://github.com/knative/serving/pull/3503) taking advantage of these helpers.","created_at":"2019-03-23T05:52:27Z","updated_at":"2019-03-23T07:23:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00e17634bd15a5af8681f868bf63e45abe71cf8d","assignee":{"login":"n3wscott","id":32305648,"node_id":"MDQ6VXNlcjMyMzA1NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false},"assignees":[{"login":"n3wscott","id":32305648,"node_id":"MDQ6VXNlcjMyMzA1NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"grantr","id":680,"node_id":"MDQ6VXNlcjY4MA==","avatar_url":"https://avatars3.githubusercontent.com/u/680?v=4","gravatar_id":"","url":"https://api.github.com/users/grantr","html_url":"https://github.com/grantr","followers_url":"https://api.github.com/users/grantr/followers","following_url":"https://api.github.com/users/grantr/following{/other_user}","gists_url":"https://api.github.com/users/grantr/gists{/gist_id}","starred_url":"https://api.github.com/users/grantr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantr/subscriptions","organizations_url":"https://api.github.com/users/grantr/orgs","repos_url":"https://api.github.com/users/grantr/repos","events_url":"https://api.github.com/users/grantr/events{/privacy}","received_events_url":"https://api.github.com/users/grantr/received_events","type":"User","site_admin":false},{"login":"tcnghia","id":138266,"node_id":"MDQ6VXNlcjEzODI2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/138266?v=4","gravatar_id":"","url":"https://api.github.com/users/tcnghia","html_url":"https://github.com/tcnghia","followers_url":"https://api.github.com/users/tcnghia/followers","following_url":"https://api.github.com/users/tcnghia/following{/other_user}","gists_url":"https://api.github.com/users/tcnghia/gists{/gist_id}","starred_url":"https://api.github.com/users/tcnghia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcnghia/subscriptions","organizations_url":"https://api.github.com/users/tcnghia/orgs","repos_url":"https://api.github.com/users/tcnghia/repos","events_url":"https://api.github.com/users/tcnghia/events{/privacy}","received_events_url":"https://api.github.com/users/tcnghia/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1006176050,"node_id":"MDU6TGFiZWwxMDA2MTc2MDUw","url":"https://api.github.com/repos/knative/pkg/labels/approved","name":"approved","color":"ededed","default":false},{"id":1070147540,"node_id":"MDU6TGFiZWwxMDcwMTQ3NTQw","url":"https://api.github.com/repos/knative/pkg/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false},{"id":1007315520,"node_id":"MDU6TGFiZWwxMDA3MzE1NTIw","url":"https://api.github.com/repos/knative/pkg/labels/size/L","name":"size/L","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/knative/pkg/pulls/335/commits","review_comments_url":"https://api.github.com/repos/knative/pkg/pulls/335/comments","review_comment_url":"https://api.github.com/repos/knative/pkg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/knative/pkg/issues/335/comments","statuses_url":"https://api.github.com/repos/knative/pkg/statuses/31fe27bfa741d26194a7e7ebd5d089b2eadd5afa","head":{"label":"mattmoor:reduce-boilerplate","ref":"reduce-boilerplate","sha":"31fe27bfa741d26194a7e7ebd5d089b2eadd5afa","user":{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false},"repo":{"id":142331919,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIzMzE5MTk=","name":"pkg-1","full_name":"mattmoor/pkg-1","private":false,"owner":{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mattmoor/pkg-1","description":"Knative common packages","fork":true,"url":"https://api.github.com/repos/mattmoor/pkg-1","forks_url":"https://api.github.com/repos/mattmoor/pkg-1/forks","keys_url":"https://api.github.com/repos/mattmoor/pkg-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattmoor/pkg-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattmoor/pkg-1/teams","hooks_url":"https://api.github.com/repos/mattmoor/pkg-1/hooks","issue_events_url":"https://api.github.com/repos/mattmoor/pkg-1/issues/events{/number}","events_url":"https://api.github.com/repos/mattmoor/pkg-1/events","assignees_url":"https://api.github.com/repos/mattmoor/pkg-1/assignees{/user}","branches_url":"https://api.github.com/repos/mattmoor/pkg-1/branches{/branch}","tags_url":"https://api.github.com/repos/mattmoor/pkg-1/tags","blobs_url":"https://api.github.com/repos/mattmoor/pkg-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattmoor/pkg-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattmoor/pkg-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattmoor/pkg-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattmoor/pkg-1/statuses/{sha}","languages_url":"https://api.github.com/repos/mattmoor/pkg-1/languages","stargazers_url":"https://api.github.com/repos/mattmoor/pkg-1/stargazers","contributors_url":"https://api.github.com/repos/mattmoor/pkg-1/contributors","subscribers_url":"https://api.github.com/repos/mattmoor/pkg-1/subscribers","subscription_url":"https://api.github.com/repos/mattmoor/pkg-1/subscription","commits_url":"https://api.github.com/repos/mattmoor/pkg-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattmoor/pkg-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattmoor/pkg-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattmoor/pkg-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattmoor/pkg-1/contents/{+path}","compare_url":"https://api.github.com/repos/mattmoor/pkg-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattmoor/pkg-1/merges","archive_url":"https://api.github.com/repos/mattmoor/pkg-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattmoor/pkg-1/downloads","issues_url":"https://api.github.com/repos/mattmoor/pkg-1/issues{/number}","pulls_url":"https://api.github.com/repos/mattmoor/pkg-1/pulls{/number}","milestones_url":"https://api.github.com/repos/mattmoor/pkg-1/milestones{/number}","notifications_url":"https://api.github.com/repos/mattmoor/pkg-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattmoor/pkg-1/labels{/name}","releases_url":"https://api.github.com/repos/mattmoor/pkg-1/releases{/id}","deployments_url":"https://api.github.com/repos/mattmoor/pkg-1/deployments","created_at":"2018-07-25T17:23:12Z","updated_at":"2018-07-25T17:23:14Z","pushed_at":"2019-03-23T05:47:10Z","git_url":"git://github.com/mattmoor/pkg-1.git","ssh_url":"git@github.com:mattmoor/pkg-1.git","clone_url":"https://github.com/mattmoor/pkg-1.git","svn_url":"https://github.com/mattmoor/pkg-1","homepage":"","size":12674,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"knative:master","ref":"master","sha":"6dbff198831064f3a82b7333582efc137575f42c","user":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"repo":{"id":142331174,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIzMzExNzQ=","name":"pkg","full_name":"knative/pkg","private":false,"owner":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/knative/pkg","description":"Knative common packages","fork":false,"url":"https://api.github.com/repos/knative/pkg","forks_url":"https://api.github.com/repos/knative/pkg/forks","keys_url":"https://api.github.com/repos/knative/pkg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knative/pkg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knative/pkg/teams","hooks_url":"https://api.github.com/repos/knative/pkg/hooks","issue_events_url":"https://api.github.com/repos/knative/pkg/issues/events{/number}","events_url":"https://api.github.com/repos/knative/pkg/events","assignees_url":"https://api.github.com/repos/knative/pkg/assignees{/user}","branches_url":"https://api.github.com/repos/knative/pkg/branches{/branch}","tags_url":"https://api.github.com/repos/knative/pkg/tags","blobs_url":"https://api.github.com/repos/knative/pkg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knative/pkg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knative/pkg/git/refs{/sha}","trees_url":"https://api.github.com/repos/knative/pkg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knative/pkg/statuses/{sha}","languages_url":"https://api.github.com/repos/knative/pkg/languages","stargazers_url":"https://api.github.com/repos/knative/pkg/stargazers","contributors_url":"https://api.github.com/repos/knative/pkg/contributors","subscribers_url":"https://api.github.com/repos/knative/pkg/subscribers","subscription_url":"https://api.github.com/repos/knative/pkg/subscription","commits_url":"https://api.github.com/repos/knative/pkg/commits{/sha}","git_commits_url":"https://api.github.com/repos/knative/pkg/git/commits{/sha}","comments_url":"https://api.github.com/repos/knative/pkg/comments{/number}","issue_comment_url":"https://api.github.com/repos/knative/pkg/issues/comments{/number}","contents_url":"https://api.github.com/repos/knative/pkg/contents/{+path}","compare_url":"https://api.github.com/repos/knative/pkg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knative/pkg/merges","archive_url":"https://api.github.com/repos/knative/pkg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knative/pkg/downloads","issues_url":"https://api.github.com/repos/knative/pkg/issues{/number}","pulls_url":"https://api.github.com/repos/knative/pkg/pulls{/number}","milestones_url":"https://api.github.com/repos/knative/pkg/milestones{/number}","notifications_url":"https://api.github.com/repos/knative/pkg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knative/pkg/labels{/name}","releases_url":"https://api.github.com/repos/knative/pkg/releases{/id}","deployments_url":"https://api.github.com/repos/knative/pkg/deployments","created_at":"2018-07-25T17:16:04Z","updated_at":"2019-03-23T05:57:24Z","pushed_at":"2019-03-23T05:52:28Z","git_url":"git://github.com/knative/pkg.git","ssh_url":"git@github.com:knative/pkg.git","clone_url":"https://github.com/knative/pkg.git","svn_url":"https://github.com/knative/pkg","homepage":"","size":12670,"stargazers_count":55,"watchers_count":55,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":76,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":76,"open_issues":28,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/knative/pkg/pulls/335"},"html":{"href":"https://github.com/knative/pkg/pull/335"},"issue":{"href":"https://api.github.com/repos/knative/pkg/issues/335"},"comments":{"href":"https://api.github.com/repos/knative/pkg/issues/335/comments"},"review_comments":{"href":"https://api.github.com/repos/knative/pkg/pulls/335/comments"},"review_comment":{"href":"https://api.github.com/repos/knative/pkg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/knative/pkg/pulls/335/commits"},"statuses":{"href":"https://api.github.com/repos/knative/pkg/statuses/31fe27bfa741d26194a7e7ebd5d089b2eadd5afa"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vagababov"}}