{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/39039116","id":39039116,"diff_hunk":"@@ -114,14 +116,37 @@ func (rc *ConsumingRC) sendOneConsumeCPUrequest(milicores int, durationSec int)\n \texpectNoError(err)\n }\n \n-func (rc *ConsumingRC) CleanUp() {\n+func (rc *ResourceConsumer) GetReplicas() int {\n+\treplicationController, err := rc.framework.Client.ReplicationControllers(rc.framework.Namespace.Name).Get(rc.name)\n+\texpectNoError(err)\n+\tif replicationController == nil {\n+\t\tFailf(rcIsNil)\n+\t}\n+\treturn replicationController.Status.Replicas\n+}\n+\n+func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int) {\n+\ttimeout := 10 * time.Minute\n+\tfor start := time.Now(); time.Since(start) < timeout; time.Sleep(20 * time.Second) {\n+\t\tif desiredReplicas == rc.GetReplicas() {\n+\t\t\tLogf(\"Replication Controller current replicas number is equal to desired replicas number: %d\", desiredReplicas)\n+\t\t\treturn\n+\t\t} else {\n+\t\t\tLogf(\"Replication Controller current replicas number %d waiting to be %d\", rc.GetReplicas(), desiredReplicas)\n+\t\t}\n+\t}\n+\tFailf(\"timeout waiting %v for pods size to be %d\", timeout, desiredReplicas)\n+}\n+\n+func (rc *ResourceConsumer) CleanUp() {\n \trc.stop <- 0\n \texpectNoError(DeleteRC(rc.framework.Client, rc.framework.Namespace.Name, rc.name))\n \texpectNoError(rc.framework.Client.Services(rc.framework.Namespace.Name).Delete(rc.name))\n+\texpectNoError(rc.framework.Client.Experimental().HorizontalPodAutoscalers(rc.framework.Namespace.Name).Delete(rc.name, api.NewDeleteOptions(0)))","path":"test/e2e/autoscaling_utils.go","position":103,"original_position":103,"commit_id":"3ddbb7d96b60ebe25c870d502090a11323ba2dcf","original_commit_id":"3ddbb7d96b60ebe25c870d502090a11323ba2dcf","user":{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false},"body":"@socaa This is a very bad pattern when you clean up here resources created by someone else. Please move this call to test/e2e/horizontal_pod_autoscaling.go","created_at":"2015-09-09T13:09:02Z","updated_at":"2015-09-09T13:09:02Z","html_url":"https://github.com/kubernetes/kubernetes/pull/13640#discussion_r39039116","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/39039116"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13640#discussion_r39039116"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640","id":44341784,"html_url":"https://github.com/kubernetes/kubernetes/pull/13640","diff_url":"https://github.com/kubernetes/kubernetes/pull/13640.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/13640.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13640","number":13640,"state":"closed","locked":false,"title":"Horizontal Pod Autoscaling e2e tests","user":{"login":"socaa","id":13236656,"avatar_url":"https://avatars.githubusercontent.com/u/13236656?v=3","gravatar_id":"","url":"https://api.github.com/users/socaa","html_url":"https://github.com/socaa","followers_url":"https://api.github.com/users/socaa/followers","following_url":"https://api.github.com/users/socaa/following{/other_user}","gists_url":"https://api.github.com/users/socaa/gists{/gist_id}","starred_url":"https://api.github.com/users/socaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socaa/subscriptions","organizations_url":"https://api.github.com/users/socaa/orgs","repos_url":"https://api.github.com/users/socaa/repos","events_url":"https://api.github.com/users/socaa/events{/privacy}","received_events_url":"https://api.github.com/users/socaa/received_events","type":"User","site_admin":false},"body":"Part of #11570\r\n\r\n@piosz \r\n@jszczepkowski ","created_at":"2015-09-07T10:32:34Z","updated_at":"2015-09-09T13:09:02Z","closed_at":"2015-09-08T12:54:17Z","merged_at":"2015-09-08T12:54:17Z","merge_commit_sha":"9239b5aa77ab33a599f97bb9945f933b3d366187","assignee":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13640/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/3ddbb7d96b60ebe25c870d502090a11323ba2dcf","head":{"label":"socaa:horizontal-pod-autoscaling-test","ref":"horizontal-pod-autoscaling-test","sha":"3ddbb7d96b60ebe25c870d502090a11323ba2dcf","user":{"login":"socaa","id":13236656,"avatar_url":"https://avatars.githubusercontent.com/u/13236656?v=3","gravatar_id":"","url":"https://api.github.com/users/socaa","html_url":"https://github.com/socaa","followers_url":"https://api.github.com/users/socaa/followers","following_url":"https://api.github.com/users/socaa/following{/other_user}","gists_url":"https://api.github.com/users/socaa/gists{/gist_id}","starred_url":"https://api.github.com/users/socaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socaa/subscriptions","organizations_url":"https://api.github.com/users/socaa/orgs","repos_url":"https://api.github.com/users/socaa/repos","events_url":"https://api.github.com/users/socaa/events{/privacy}","received_events_url":"https://api.github.com/users/socaa/received_events","type":"User","site_admin":false},"repo":{"id":38752063,"name":"kubernetes","full_name":"socaa/kubernetes","owner":{"login":"socaa","id":13236656,"avatar_url":"https://avatars.githubusercontent.com/u/13236656?v=3","gravatar_id":"","url":"https://api.github.com/users/socaa","html_url":"https://github.com/socaa","followers_url":"https://api.github.com/users/socaa/followers","following_url":"https://api.github.com/users/socaa/following{/other_user}","gists_url":"https://api.github.com/users/socaa/gists{/gist_id}","starred_url":"https://api.github.com/users/socaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socaa/subscriptions","organizations_url":"https://api.github.com/users/socaa/orgs","repos_url":"https://api.github.com/users/socaa/repos","events_url":"https://api.github.com/users/socaa/events{/privacy}","received_events_url":"https://api.github.com/users/socaa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/socaa/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/socaa/kubernetes","forks_url":"https://api.github.com/repos/socaa/kubernetes/forks","keys_url":"https://api.github.com/repos/socaa/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/socaa/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/socaa/kubernetes/teams","hooks_url":"https://api.github.com/repos/socaa/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/socaa/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/socaa/kubernetes/events","assignees_url":"https://api.github.com/repos/socaa/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/socaa/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/socaa/kubernetes/tags","blobs_url":"https://api.github.com/repos/socaa/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/socaa/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/socaa/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/socaa/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/socaa/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/socaa/kubernetes/languages","stargazers_url":"https://api.github.com/repos/socaa/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/socaa/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/socaa/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/socaa/kubernetes/subscription","commits_url":"https://api.github.com/repos/socaa/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/socaa/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/socaa/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/socaa/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/socaa/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/socaa/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/socaa/kubernetes/merges","archive_url":"https://api.github.com/repos/socaa/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/socaa/kubernetes/downloads","issues_url":"https://api.github.com/repos/socaa/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/socaa/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/socaa/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/socaa/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/socaa/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/socaa/kubernetes/releases{/id}","created_at":"2015-07-08T12:16:51Z","updated_at":"2015-07-08T12:16:58Z","pushed_at":"2015-09-08T11:29:37Z","git_url":"git://github.com/socaa/kubernetes.git","ssh_url":"git@github.com:socaa/kubernetes.git","clone_url":"https://github.com/socaa/kubernetes.git","svn_url":"https://github.com/socaa/kubernetes","homepage":"http://kubernetes.io","size":104431,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"0d21b5888fed9b5b23bd5e3522c0aa105615e7d5","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-09-09T12:42:39Z","pushed_at":"2015-09-09T13:08:57Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":400086,"stargazers_count":10149,"watchers_count":10149,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2483,"mirror_url":null,"open_issues_count":1708,"forks":2483,"open_issues":1708,"watchers":10149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13640"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13640"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13640/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13640/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/3ddbb7d96b60ebe25c870d502090a11323ba2dcf"}}}}