{"action":"created","comment":{"url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/comments/68073892","id":68073892,"diff_hunk":"@@ -58,12 +61,19 @@ func (r *Runner) Run() error {\n \t\treturn err\n \t}\n \n-\tgo r.cmd.Wait() // reap child process if it dies\n+\tr.wg.Add(1)\n+\tgo func() {\n+\t\tr.cmd.Wait()\n+\t\tatomic.StoreInt32(&r.exited, 1)\n+\t\tr.wg.Done()\n+\t}()\n \n \tr.Logger.Info(\"agent-runner.run.success\")\n \treturn nil\n }\n \n+func (r *Runner) Exited() bool { return atomic.LoadInt32(&r.exited) == 1 }","path":"src/confab/agent/runner.go","position":36,"original_position":36,"commit_id":"7bf28e2e35a74b3f67372f3e373141f69de18c68","original_commit_id":"7bf28e2e35a74b3f67372f3e373141f69de18c68","user":{"login":"charlievieth","id":4875142,"avatar_url":"https://avatars.githubusercontent.com/u/4875142?v=3","gravatar_id":"","url":"https://api.github.com/users/charlievieth","html_url":"https://github.com/charlievieth","followers_url":"https://api.github.com/users/charlievieth/followers","following_url":"https://api.github.com/users/charlievieth/following{/other_user}","gists_url":"https://api.github.com/users/charlievieth/gists{/gist_id}","starred_url":"https://api.github.com/users/charlievieth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlievieth/subscriptions","organizations_url":"https://api.github.com/users/charlievieth/orgs","repos_url":"https://api.github.com/users/charlievieth/repos","events_url":"https://api.github.com/users/charlievieth/events{/privacy}","received_events_url":"https://api.github.com/users/charlievieth/received_events","type":"User","site_admin":false},"body":"The implementation of `os.Process.Wait` provides a stronger and better tested assertion that the process is running, and is cross-platform (unix: [wait4](http://linux.die.net/man/2/wait4) windows: [ WaitForSingleObject](https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx)).  Since a call to `Wait` must occur after a call to `Run` I don't see the value in polling (we know the process either started or failed to start) when the standard library and OS provides the ability to wait for a process to exit.  \r\n\r\nAdditionally, we should probably by checking the error returned by `Wait`, this was being discarded completely in the previous implementation.","created_at":"2016-06-22T15:23:03Z","updated_at":"2016-06-22T15:23:03Z","html_url":"https://github.com/cloudfoundry-incubator/consul-release/pull/24#discussion_r68073892","pull_request_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/comments/68073892"},"html":{"href":"https://github.com/cloudfoundry-incubator/consul-release/pull/24#discussion_r68073892"},"pull_request":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24","id":74255021,"html_url":"https://github.com/cloudfoundry-incubator/consul-release/pull/24","diff_url":"https://github.com/cloudfoundry-incubator/consul-release/pull/24.diff","patch_url":"https://github.com/cloudfoundry-incubator/consul-release/pull/24.patch","issue_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/issues/24","number":24,"state":"open","locked":false,"title":"Windows tests","user":{"login":"bdshroyer","id":7258489,"avatar_url":"https://avatars.githubusercontent.com/u/7258489?v=3","gravatar_id":"","url":"https://api.github.com/users/bdshroyer","html_url":"https://github.com/bdshroyer","followers_url":"https://api.github.com/users/bdshroyer/followers","following_url":"https://api.github.com/users/bdshroyer/following{/other_user}","gists_url":"https://api.github.com/users/bdshroyer/gists{/gist_id}","starred_url":"https://api.github.com/users/bdshroyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdshroyer/subscriptions","organizations_url":"https://api.github.com/users/bdshroyer/orgs","repos_url":"https://api.github.com/users/bdshroyer/repos","events_url":"https://api.github.com/users/bdshroyer/events{/privacy}","received_events_url":"https://api.github.com/users/bdshroyer/received_events","type":"User","site_admin":false},"body":"Adds cross-platform support to consul-release tests\r\n\r\nWe made some implementation changes in order to make things more Windows-friendly, including:\r\n\r\n- the runner now waits using `cmd.Wait()` rather than signal 0-ing the process in a loop\r\n- the runner has an `Exited` method to make it possible to assert on whether the runner's process has exited from tests\r\n- we use `filepath.Join` everywhere instead of `path.Join`, since `filepath` uses OS-specific directory separators\r\n\r\nFor the \"checks sync state up to the timeout\" test in `confab_test.go` we weren't sure of the importance of the timeout tolerances, and on Windows, they weren't big enough to consistently pass. We skipped this test rather than changing the tolerances, but we'd like to have this one run.","created_at":"2016-06-17T14:51:21Z","updated_at":"2016-06-22T15:23:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1266111b37b1951afad5ee99e5bc29df68db9add","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24/commits","review_comments_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24/comments","review_comment_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/issues/24/comments","statuses_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/statuses/7bf28e2e35a74b3f67372f3e373141f69de18c68","head":{"label":"bdshroyer:windows-tests","ref":"windows-tests","sha":"7bf28e2e35a74b3f67372f3e373141f69de18c68","user":{"login":"bdshroyer","id":7258489,"avatar_url":"https://avatars.githubusercontent.com/u/7258489?v=3","gravatar_id":"","url":"https://api.github.com/users/bdshroyer","html_url":"https://github.com/bdshroyer","followers_url":"https://api.github.com/users/bdshroyer/followers","following_url":"https://api.github.com/users/bdshroyer/following{/other_user}","gists_url":"https://api.github.com/users/bdshroyer/gists{/gist_id}","starred_url":"https://api.github.com/users/bdshroyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdshroyer/subscriptions","organizations_url":"https://api.github.com/users/bdshroyer/orgs","repos_url":"https://api.github.com/users/bdshroyer/repos","events_url":"https://api.github.com/users/bdshroyer/events{/privacy}","received_events_url":"https://api.github.com/users/bdshroyer/received_events","type":"User","site_admin":false},"repo":{"id":61376654,"name":"consul-release","full_name":"bdshroyer/consul-release","owner":{"login":"bdshroyer","id":7258489,"avatar_url":"https://avatars.githubusercontent.com/u/7258489?v=3","gravatar_id":"","url":"https://api.github.com/users/bdshroyer","html_url":"https://github.com/bdshroyer","followers_url":"https://api.github.com/users/bdshroyer/followers","following_url":"https://api.github.com/users/bdshroyer/following{/other_user}","gists_url":"https://api.github.com/users/bdshroyer/gists{/gist_id}","starred_url":"https://api.github.com/users/bdshroyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdshroyer/subscriptions","organizations_url":"https://api.github.com/users/bdshroyer/orgs","repos_url":"https://api.github.com/users/bdshroyer/repos","events_url":"https://api.github.com/users/bdshroyer/events{/privacy}","received_events_url":"https://api.github.com/users/bdshroyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bdshroyer/consul-release","description":"","fork":true,"url":"https://api.github.com/repos/bdshroyer/consul-release","forks_url":"https://api.github.com/repos/bdshroyer/consul-release/forks","keys_url":"https://api.github.com/repos/bdshroyer/consul-release/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bdshroyer/consul-release/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bdshroyer/consul-release/teams","hooks_url":"https://api.github.com/repos/bdshroyer/consul-release/hooks","issue_events_url":"https://api.github.com/repos/bdshroyer/consul-release/issues/events{/number}","events_url":"https://api.github.com/repos/bdshroyer/consul-release/events","assignees_url":"https://api.github.com/repos/bdshroyer/consul-release/assignees{/user}","branches_url":"https://api.github.com/repos/bdshroyer/consul-release/branches{/branch}","tags_url":"https://api.github.com/repos/bdshroyer/consul-release/tags","blobs_url":"https://api.github.com/repos/bdshroyer/consul-release/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bdshroyer/consul-release/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bdshroyer/consul-release/git/refs{/sha}","trees_url":"https://api.github.com/repos/bdshroyer/consul-release/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bdshroyer/consul-release/statuses/{sha}","languages_url":"https://api.github.com/repos/bdshroyer/consul-release/languages","stargazers_url":"https://api.github.com/repos/bdshroyer/consul-release/stargazers","contributors_url":"https://api.github.com/repos/bdshroyer/consul-release/contributors","subscribers_url":"https://api.github.com/repos/bdshroyer/consul-release/subscribers","subscription_url":"https://api.github.com/repos/bdshroyer/consul-release/subscription","commits_url":"https://api.github.com/repos/bdshroyer/consul-release/commits{/sha}","git_commits_url":"https://api.github.com/repos/bdshroyer/consul-release/git/commits{/sha}","comments_url":"https://api.github.com/repos/bdshroyer/consul-release/comments{/number}","issue_comment_url":"https://api.github.com/repos/bdshroyer/consul-release/issues/comments{/number}","contents_url":"https://api.github.com/repos/bdshroyer/consul-release/contents/{+path}","compare_url":"https://api.github.com/repos/bdshroyer/consul-release/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bdshroyer/consul-release/merges","archive_url":"https://api.github.com/repos/bdshroyer/consul-release/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bdshroyer/consul-release/downloads","issues_url":"https://api.github.com/repos/bdshroyer/consul-release/issues{/number}","pulls_url":"https://api.github.com/repos/bdshroyer/consul-release/pulls{/number}","milestones_url":"https://api.github.com/repos/bdshroyer/consul-release/milestones{/number}","notifications_url":"https://api.github.com/repos/bdshroyer/consul-release/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bdshroyer/consul-release/labels{/name}","releases_url":"https://api.github.com/repos/bdshroyer/consul-release/releases{/id}","deployments_url":"https://api.github.com/repos/bdshroyer/consul-release/deployments","created_at":"2016-06-17T13:45:19Z","updated_at":"2016-06-17T13:45:20Z","pushed_at":"2016-06-20T20:21:48Z","git_url":"git://github.com/bdshroyer/consul-release.git","ssh_url":"git@github.com:bdshroyer/consul-release.git","clone_url":"https://github.com/bdshroyer/consul-release.git","svn_url":"https://github.com/bdshroyer/consul-release","homepage":null,"size":730,"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":"cloudfoundry-incubator:develop","ref":"develop","sha":"8f3e898bcf6bd798334b3db2eefe179564dc8392","user":{"login":"cloudfoundry-incubator","id":5680605,"avatar_url":"https://avatars.githubusercontent.com/u/5680605?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudfoundry-incubator","html_url":"https://github.com/cloudfoundry-incubator","followers_url":"https://api.github.com/users/cloudfoundry-incubator/followers","following_url":"https://api.github.com/users/cloudfoundry-incubator/following{/other_user}","gists_url":"https://api.github.com/users/cloudfoundry-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudfoundry-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudfoundry-incubator/subscriptions","organizations_url":"https://api.github.com/users/cloudfoundry-incubator/orgs","repos_url":"https://api.github.com/users/cloudfoundry-incubator/repos","events_url":"https://api.github.com/users/cloudfoundry-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/cloudfoundry-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":39106630,"name":"consul-release","full_name":"cloudfoundry-incubator/consul-release","owner":{"login":"cloudfoundry-incubator","id":5680605,"avatar_url":"https://avatars.githubusercontent.com/u/5680605?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudfoundry-incubator","html_url":"https://github.com/cloudfoundry-incubator","followers_url":"https://api.github.com/users/cloudfoundry-incubator/followers","following_url":"https://api.github.com/users/cloudfoundry-incubator/following{/other_user}","gists_url":"https://api.github.com/users/cloudfoundry-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudfoundry-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudfoundry-incubator/subscriptions","organizations_url":"https://api.github.com/users/cloudfoundry-incubator/orgs","repos_url":"https://api.github.com/users/cloudfoundry-incubator/repos","events_url":"https://api.github.com/users/cloudfoundry-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/cloudfoundry-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudfoundry-incubator/consul-release","description":"","fork":false,"url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release","forks_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/forks","keys_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/teams","hooks_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/hooks","issue_events_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/issues/events{/number}","events_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/events","assignees_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/assignees{/user}","branches_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/branches{/branch}","tags_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/tags","blobs_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/languages","stargazers_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/stargazers","contributors_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/contributors","subscribers_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/subscribers","subscription_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/subscription","commits_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/contents/{+path}","compare_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/merges","archive_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/downloads","issues_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/issues{/number}","pulls_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/labels{/name}","releases_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/releases{/id}","deployments_url":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/deployments","created_at":"2015-07-15T00:01:34Z","updated_at":"2016-01-13T23:47:12Z","pushed_at":"2016-06-20T20:21:49Z","git_url":"git://github.com/cloudfoundry-incubator/consul-release.git","ssh_url":"git@github.com:cloudfoundry-incubator/consul-release.git","clone_url":"https://github.com/cloudfoundry-incubator/consul-release.git","svn_url":"https://github.com/cloudfoundry-incubator/consul-release","homepage":null,"size":718,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":1,"forks":17,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24"},"html":{"href":"https://github.com/cloudfoundry-incubator/consul-release/pull/24"},"issue":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/issues/24"},"comments":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/cloudfoundry-incubator/consul-release/statuses/7bf28e2e35a74b3f67372f3e373141f69de18c68"}}}}
{"actor":{"display_login":"charlievieth"}}