{"action":"created","comment":{"url":"https://api.github.com/repos/square/p2/pulls/comments/55902475","id":55902475,"diff_hunk":"@@ -138,19 +158,389 @@ func SimulateRollingUpgradeDisable(t *testing.T, full, nonew bool) {\n \t\tAssert(t).IsTrue(len(old)+len(new) >= minimum, fmt.Sprintf(\"went below %d minimum nodes (nodes %v)\\n\", minimum, nodes))\n \t\tAssert(t).IsTrue(len(new) <= target, fmt.Sprintf(\"went above %d target nodes (nodes %v)\\n\", target, nodes))\n \t\tif len(new) == target {\n-\t\t\tAssert(t).AreEqual(rollAlgorithm(len(old), len(new), target, minimum), 0, \"update should be done\")\n+\t\t\tnextRemove, nextAdd := rollAlgorithm(len(old), len(new), target, target, minimum)\n+\t\t\tAssert(t).AreEqual(nextRemove, 0, \"update should be done, should remove nothing\")\n+\t\t\tAssert(t).AreEqual(nextAdd, 0, \"update should be done, should add nothing\")\n \t\t\tt.Logf(\"Simulation complete\\n\\n\")\n \t\t\tbreak\n \t\t}\n \n \t\t// calculate the next update\n-\t\tnextUpdate := rollAlgorithm(len(old), len(new), target, minimum)\n-\t\tt.Logf(\"Scheduling %d new out of %v eligible\\n\", nextUpdate, eligible)\n-\t\tAssert(t).AreNotEqual(nextUpdate, 0, \"got noop update, would never terminate\")\n+\t\tnextRemove, nextAdd := rollAlgorithm(len(old), len(new), target, target, minimum)\n+\t\tAssert(t).AreEqual(nextRemove, nextAdd, \"got asymmetric update, not expected for this fuzz test\")\n+\t\tt.Logf(\"Scheduling %d new out of %v eligible\\n\", nextAdd, eligible)\n+\t\tAssert(t).AreNotEqual(nextAdd, 0, \"got noop update, would never terminate\")\n \t\t// choose nodes from the eligible list, randomly, and put the new pod\n \t\t// on them\n-\t\tfor _, index := range rand.Perm(len(eligible))[:nextUpdate] {\n+\t\tfor _, index := range rand.Perm(len(eligible))[:nextAdd] {\n \t\t\tnodes[eligible[index]] = 1\n \t\t}\n \t}\n }\n+\n+type fakeHealthChecker struct {","path":"pkg/roll/update_test.go","position":null,"original_position":79,"commit_id":"3e493056a106c97f097f841f05c33fdecd08d983","original_commit_id":"b0f4fd11f7339fc241515eec73c664b6217cdc79","user":{"login":"petertseng","id":346181,"avatar_url":"https://avatars.githubusercontent.com/u/346181?v=3","gravatar_id":"","url":"https://api.github.com/users/petertseng","html_url":"https://github.com/petertseng","followers_url":"https://api.github.com/users/petertseng/followers","following_url":"https://api.github.com/users/petertseng/following{/other_user}","gists_url":"https://api.github.com/users/petertseng/gists{/gist_id}","starred_url":"https://api.github.com/users/petertseng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petertseng/subscriptions","organizations_url":"https://api.github.com/users/petertseng/orgs","repos_url":"https://api.github.com/users/petertseng/repos","events_url":"https://api.github.com/users/petertseng/events{/privacy}","received_events_url":"https://api.github.com/users/petertseng/received_events","type":"User","site_admin":false},"body":"added in 3c5192ce10c0ad0e93fed3b2a7515c48c0aa3a53 though I left a TODO that replication tests should probably put some stuff in there. maybe I'll just do that now instead of leaving the TODO","created_at":"2016-03-11T23:05:26Z","updated_at":"2016-03-11T23:05:26Z","html_url":"https://github.com/square/p2/pull/408#discussion_r55902475","pull_request_url":"https://api.github.com/repos/square/p2/pulls/408","_links":{"self":{"href":"https://api.github.com/repos/square/p2/pulls/comments/55902475"},"html":{"href":"https://github.com/square/p2/pull/408#discussion_r55902475"},"pull_request":{"href":"https://api.github.com/repos/square/p2/pulls/408"}}},"pull_request":{"url":"https://api.github.com/repos/square/p2/pulls/408","id":62325292,"html_url":"https://github.com/square/p2/pull/408","diff_url":"https://github.com/square/p2/pull/408.diff","patch_url":"https://github.com/square/p2/pull/408.patch","issue_url":"https://api.github.com/repos/square/p2/issues/408","number":408,"state":"open","locked":false,"title":"roll: conservatively treat unknown-health nodes as healthy; support capacity increase","user":{"login":"petertseng","id":346181,"avatar_url":"https://avatars.githubusercontent.com/u/346181?v=3","gravatar_id":"","url":"https://api.github.com/users/petertseng","html_url":"https://github.com/petertseng","followers_url":"https://api.github.com/users/petertseng/followers","following_url":"https://api.github.com/users/petertseng/following{/other_user}","gists_url":"https://api.github.com/users/petertseng/gists{/gist_id}","starred_url":"https://api.github.com/users/petertseng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petertseng/subscriptions","organizations_url":"https://api.github.com/users/petertseng/orgs","repos_url":"https://api.github.com/users/petertseng/repos","events_url":"https://api.github.com/users/petertseng/events{/privacy}","received_events_url":"https://api.github.com/users/petertseng/received_events","type":"User","site_admin":false},"body":"We wish to be conservative because we don't want to mistakenly take down\r\na node of unknown health only to find out that it is healthy. The other\r\nadvantage of this is that it supports easily migrating apps from other\r\ndeployment systems which may not report health.","created_at":"2016-03-10T01:22:23Z","updated_at":"2016-03-11T23:05:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6660af254d4d702c0131b2240f9de7eabf9ec834","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/square/p2/pulls/408/commits","review_comments_url":"https://api.github.com/repos/square/p2/pulls/408/comments","review_comment_url":"https://api.github.com/repos/square/p2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/p2/issues/408/comments","statuses_url":"https://api.github.com/repos/square/p2/statuses/3e493056a106c97f097f841f05c33fdecd08d983","head":{"label":"petertseng:roll-unknown","ref":"roll-unknown","sha":"3e493056a106c97f097f841f05c33fdecd08d983","user":{"login":"petertseng","id":346181,"avatar_url":"https://avatars.githubusercontent.com/u/346181?v=3","gravatar_id":"","url":"https://api.github.com/users/petertseng","html_url":"https://github.com/petertseng","followers_url":"https://api.github.com/users/petertseng/followers","following_url":"https://api.github.com/users/petertseng/following{/other_user}","gists_url":"https://api.github.com/users/petertseng/gists{/gist_id}","starred_url":"https://api.github.com/users/petertseng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petertseng/subscriptions","organizations_url":"https://api.github.com/users/petertseng/orgs","repos_url":"https://api.github.com/users/petertseng/repos","events_url":"https://api.github.com/users/petertseng/events{/privacy}","received_events_url":"https://api.github.com/users/petertseng/received_events","type":"User","site_admin":false},"repo":{"id":38632684,"name":"p2","full_name":"petertseng/p2","owner":{"login":"petertseng","id":346181,"avatar_url":"https://avatars.githubusercontent.com/u/346181?v=3","gravatar_id":"","url":"https://api.github.com/users/petertseng","html_url":"https://github.com/petertseng","followers_url":"https://api.github.com/users/petertseng/followers","following_url":"https://api.github.com/users/petertseng/following{/other_user}","gists_url":"https://api.github.com/users/petertseng/gists{/gist_id}","starred_url":"https://api.github.com/users/petertseng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petertseng/subscriptions","organizations_url":"https://api.github.com/users/petertseng/orgs","repos_url":"https://api.github.com/users/petertseng/repos","events_url":"https://api.github.com/users/petertseng/events{/privacy}","received_events_url":"https://api.github.com/users/petertseng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/petertseng/p2","description":"Platypus Platform: Tools for Scalable Deployment","fork":true,"url":"https://api.github.com/repos/petertseng/p2","forks_url":"https://api.github.com/repos/petertseng/p2/forks","keys_url":"https://api.github.com/repos/petertseng/p2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petertseng/p2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petertseng/p2/teams","hooks_url":"https://api.github.com/repos/petertseng/p2/hooks","issue_events_url":"https://api.github.com/repos/petertseng/p2/issues/events{/number}","events_url":"https://api.github.com/repos/petertseng/p2/events","assignees_url":"https://api.github.com/repos/petertseng/p2/assignees{/user}","branches_url":"https://api.github.com/repos/petertseng/p2/branches{/branch}","tags_url":"https://api.github.com/repos/petertseng/p2/tags","blobs_url":"https://api.github.com/repos/petertseng/p2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petertseng/p2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petertseng/p2/git/refs{/sha}","trees_url":"https://api.github.com/repos/petertseng/p2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petertseng/p2/statuses/{sha}","languages_url":"https://api.github.com/repos/petertseng/p2/languages","stargazers_url":"https://api.github.com/repos/petertseng/p2/stargazers","contributors_url":"https://api.github.com/repos/petertseng/p2/contributors","subscribers_url":"https://api.github.com/repos/petertseng/p2/subscribers","subscription_url":"https://api.github.com/repos/petertseng/p2/subscription","commits_url":"https://api.github.com/repos/petertseng/p2/commits{/sha}","git_commits_url":"https://api.github.com/repos/petertseng/p2/git/commits{/sha}","comments_url":"https://api.github.com/repos/petertseng/p2/comments{/number}","issue_comment_url":"https://api.github.com/repos/petertseng/p2/issues/comments{/number}","contents_url":"https://api.github.com/repos/petertseng/p2/contents/{+path}","compare_url":"https://api.github.com/repos/petertseng/p2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petertseng/p2/merges","archive_url":"https://api.github.com/repos/petertseng/p2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petertseng/p2/downloads","issues_url":"https://api.github.com/repos/petertseng/p2/issues{/number}","pulls_url":"https://api.github.com/repos/petertseng/p2/pulls{/number}","milestones_url":"https://api.github.com/repos/petertseng/p2/milestones{/number}","notifications_url":"https://api.github.com/repos/petertseng/p2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petertseng/p2/labels{/name}","releases_url":"https://api.github.com/repos/petertseng/p2/releases{/id}","deployments_url":"https://api.github.com/repos/petertseng/p2/deployments","created_at":"2015-07-06T16:51:15Z","updated_at":"2016-01-21T20:04:33Z","pushed_at":"2016-03-11T23:04:06Z","git_url":"git://github.com/petertseng/p2.git","ssh_url":"git@github.com:petertseng/p2.git","clone_url":"https://github.com/petertseng/p2.git","svn_url":"https://github.com/petertseng/p2","homepage":"","size":32920,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"1401de57c1e2cc449592891e7eafa9ab0ef974be","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":25320424,"name":"p2","full_name":"square/p2","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/p2","description":"Platypus Platform: Tools for Scalable Deployment","fork":false,"url":"https://api.github.com/repos/square/p2","forks_url":"https://api.github.com/repos/square/p2/forks","keys_url":"https://api.github.com/repos/square/p2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/p2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/p2/teams","hooks_url":"https://api.github.com/repos/square/p2/hooks","issue_events_url":"https://api.github.com/repos/square/p2/issues/events{/number}","events_url":"https://api.github.com/repos/square/p2/events","assignees_url":"https://api.github.com/repos/square/p2/assignees{/user}","branches_url":"https://api.github.com/repos/square/p2/branches{/branch}","tags_url":"https://api.github.com/repos/square/p2/tags","blobs_url":"https://api.github.com/repos/square/p2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/p2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/p2/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/p2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/p2/statuses/{sha}","languages_url":"https://api.github.com/repos/square/p2/languages","stargazers_url":"https://api.github.com/repos/square/p2/stargazers","contributors_url":"https://api.github.com/repos/square/p2/contributors","subscribers_url":"https://api.github.com/repos/square/p2/subscribers","subscription_url":"https://api.github.com/repos/square/p2/subscription","commits_url":"https://api.github.com/repos/square/p2/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/p2/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/p2/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/p2/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/p2/contents/{+path}","compare_url":"https://api.github.com/repos/square/p2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/p2/merges","archive_url":"https://api.github.com/repos/square/p2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/p2/downloads","issues_url":"https://api.github.com/repos/square/p2/issues{/number}","pulls_url":"https://api.github.com/repos/square/p2/pulls{/number}","milestones_url":"https://api.github.com/repos/square/p2/milestones{/number}","notifications_url":"https://api.github.com/repos/square/p2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/p2/labels{/name}","releases_url":"https://api.github.com/repos/square/p2/releases{/id}","deployments_url":"https://api.github.com/repos/square/p2/deployments","created_at":"2014-10-16T20:31:12Z","updated_at":"2016-03-11T16:05:18Z","pushed_at":"2016-03-11T23:04:06Z","git_url":"git://github.com/square/p2.git","ssh_url":"git@github.com:square/p2.git","clone_url":"https://github.com/square/p2.git","svn_url":"https://github.com/square/p2","homepage":"","size":33135,"stargazers_count":100,"watchers_count":100,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":6,"forks":17,"open_issues":6,"watchers":100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/p2/pulls/408"},"html":{"href":"https://github.com/square/p2/pull/408"},"issue":{"href":"https://api.github.com/repos/square/p2/issues/408"},"comments":{"href":"https://api.github.com/repos/square/p2/issues/408/comments"},"review_comments":{"href":"https://api.github.com/repos/square/p2/pulls/408/comments"},"review_comment":{"href":"https://api.github.com/repos/square/p2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/p2/pulls/408/commits"},"statuses":{"href":"https://api.github.com/repos/square/p2/statuses/3e493056a106c97f097f841f05c33fdecd08d983"}}}}