{"action":"created","comment":{"url":"https://api.github.com/repos/ppy/osu-framework/pulls/comments/84500181","pull_request_review_id":5276632,"id":84500181,"diff_hunk":"@@ -18,37 +18,36 @@ private class Foobar\n         {\r\n             public string Bar;\r\n         }\r\n-    \r\n+\r\n         [Test]\r\n-        public async Task TestIpc()\r\n+        public void TestIpc()\r\n         {\r\n-            using (var server = new HeadlessGameHost())\r\n-            using (var client = new HeadlessGameHost())\r\n+            using (var server = new HeadlessGameHost(true))\r\n+            using (var client = new HeadlessGameHost(true))\r\n             {\r\n-                server.Load(null);\r\n-                client.Load(null);\r\n-\r\n                 Assert.IsTrue(server.IsPrimaryInstance, @\"Server wasn't able to bind\");\r\n                 Assert.IsFalse(client.IsPrimaryInstance, @\"Client was able to bind when it shouldn't have been able to\");\r\n \r\n                 var serverChannel = new IpcChannel<Foobar>(server);\r\n                 var clientChannel = new IpcChannel<Foobar>(client);\r\n-                bool messageReceived = false;\r\n-                serverChannel.MessageReceived += message =>\r\n+\r\n+                Action waitAction = () =>\r\n                 {\r\n-                    messageReceived = true;\r\n-                    Assert.AreEqual(\"example\", message.Bar);\r\n+                    bool received = false;\r\n+                    serverChannel.MessageReceived += message =>\r\n+                    {\r\n+                        Assert.AreEqual(\"example\", message.Bar);\r\n+                        received = true;\r\n+                    };\r\n+\r\n+                    clientChannel.SendMessage(new Foobar { Bar = \"example\" }).Wait();\r\n+\r\n+                    while (!received)\r\n+                        Thread.Sleep(1);\r\n                 };\r\n-                await clientChannel.SendMessage(new Foobar { Bar = \"example\" });\r\n-                var watch = new Stopwatch();\r\n-                while (!messageReceived)\r\n-                {\r\n-                    // hacky, yes. This gives the server code time to process the message\r\n-                    Thread.Sleep(1);\r\n-                    if (watch.Elapsed.TotalSeconds > 1)\r\n-                        Assert.Fail();\r\n-                }\r\n-                Assert.Pass();\r\n+\r\n+                Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(1000),\r\n+                    @\"Message was not received in a timely fashion\");\r","path":"osu.Framework.Desktop.Tests/Platform/HeadlessGameHostTest.cs","position":54,"original_position":54,"commit_id":"90a5e4c95ee6efaef55202028c02910ea447f172","original_commit_id":"90a5e4c95ee6efaef55202028c02910ea447f172","user":{"login":"peppy","id":191335,"avatar_url":"https://avatars.githubusercontent.com/u/191335?v=3","gravatar_id":"","url":"https://api.github.com/users/peppy","html_url":"https://github.com/peppy","followers_url":"https://api.github.com/users/peppy/followers","following_url":"https://api.github.com/users/peppy/following{/other_user}","gists_url":"https://api.github.com/users/peppy/gists{/gist_id}","starred_url":"https://api.github.com/users/peppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peppy/subscriptions","organizations_url":"https://api.github.com/users/peppy/orgs","repos_url":"https://api.github.com/users/peppy/repos","events_url":"https://api.github.com/users/peppy/events{/privacy}","received_events_url":"https://api.github.com/users/peppy/received_events","type":"User","site_admin":false},"body":"took the opportunity ¯\\_(ツ)_/¯","created_at":"2016-10-21T15:16:49Z","updated_at":"2016-10-21T15:16:49Z","html_url":"https://github.com/ppy/osu-framework/pull/205#discussion_r84500181","pull_request_url":"https://api.github.com/repos/ppy/osu-framework/pulls/205","_links":{"self":{"href":"https://api.github.com/repos/ppy/osu-framework/pulls/comments/84500181"},"html":{"href":"https://github.com/ppy/osu-framework/pull/205#discussion_r84500181"},"pull_request":{"href":"https://api.github.com/repos/ppy/osu-framework/pulls/205"}}},"pull_request":{"url":"https://api.github.com/repos/ppy/osu-framework/pulls/205","id":90333892,"html_url":"https://github.com/ppy/osu-framework/pull/205","diff_url":"https://github.com/ppy/osu-framework/pull/205.diff","patch_url":"https://github.com/ppy/osu-framework/pull/205.patch","issue_url":"https://api.github.com/repos/ppy/osu-framework/issues/205","number":205,"state":"open","locked":false,"title":"General fixes","user":{"login":"peppy","id":191335,"avatar_url":"https://avatars.githubusercontent.com/u/191335?v=3","gravatar_id":"","url":"https://api.github.com/users/peppy","html_url":"https://github.com/peppy","followers_url":"https://api.github.com/users/peppy/followers","following_url":"https://api.github.com/users/peppy/following{/other_user}","gists_url":"https://api.github.com/users/peppy/gists{/gist_id}","starred_url":"https://api.github.com/users/peppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peppy/subscriptions","organizations_url":"https://api.github.com/users/peppy/orgs","repos_url":"https://api.github.com/users/peppy/repos","events_url":"https://api.github.com/users/peppy/events{/privacy}","received_events_url":"https://api.github.com/users/peppy/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-21T07:19:58Z","updated_at":"2016-10-21T15:16:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fb97bddc24b3b943f7bbbc16241bb5573781db8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ppy/osu-framework/pulls/205/commits","review_comments_url":"https://api.github.com/repos/ppy/osu-framework/pulls/205/comments","review_comment_url":"https://api.github.com/repos/ppy/osu-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ppy/osu-framework/issues/205/comments","statuses_url":"https://api.github.com/repos/ppy/osu-framework/statuses/90a5e4c95ee6efaef55202028c02910ea447f172","head":{"label":"peppy:general-fixes","ref":"general-fixes","sha":"90a5e4c95ee6efaef55202028c02910ea447f172","user":{"login":"peppy","id":191335,"avatar_url":"https://avatars.githubusercontent.com/u/191335?v=3","gravatar_id":"","url":"https://api.github.com/users/peppy","html_url":"https://github.com/peppy","followers_url":"https://api.github.com/users/peppy/followers","following_url":"https://api.github.com/users/peppy/following{/other_user}","gists_url":"https://api.github.com/users/peppy/gists{/gist_id}","starred_url":"https://api.github.com/users/peppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peppy/subscriptions","organizations_url":"https://api.github.com/users/peppy/orgs","repos_url":"https://api.github.com/users/peppy/repos","events_url":"https://api.github.com/users/peppy/events{/privacy}","received_events_url":"https://api.github.com/users/peppy/received_events","type":"User","site_admin":false},"repo":{"id":66810604,"name":"osu-framework","full_name":"peppy/osu-framework","owner":{"login":"peppy","id":191335,"avatar_url":"https://avatars.githubusercontent.com/u/191335?v=3","gravatar_id":"","url":"https://api.github.com/users/peppy","html_url":"https://github.com/peppy","followers_url":"https://api.github.com/users/peppy/followers","following_url":"https://api.github.com/users/peppy/following{/other_user}","gists_url":"https://api.github.com/users/peppy/gists{/gist_id}","starred_url":"https://api.github.com/users/peppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peppy/subscriptions","organizations_url":"https://api.github.com/users/peppy/orgs","repos_url":"https://api.github.com/users/peppy/repos","events_url":"https://api.github.com/users/peppy/events{/privacy}","received_events_url":"https://api.github.com/users/peppy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peppy/osu-framework","description":"A game framework written with osu! in mind.","fork":true,"url":"https://api.github.com/repos/peppy/osu-framework","forks_url":"https://api.github.com/repos/peppy/osu-framework/forks","keys_url":"https://api.github.com/repos/peppy/osu-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peppy/osu-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peppy/osu-framework/teams","hooks_url":"https://api.github.com/repos/peppy/osu-framework/hooks","issue_events_url":"https://api.github.com/repos/peppy/osu-framework/issues/events{/number}","events_url":"https://api.github.com/repos/peppy/osu-framework/events","assignees_url":"https://api.github.com/repos/peppy/osu-framework/assignees{/user}","branches_url":"https://api.github.com/repos/peppy/osu-framework/branches{/branch}","tags_url":"https://api.github.com/repos/peppy/osu-framework/tags","blobs_url":"https://api.github.com/repos/peppy/osu-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peppy/osu-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peppy/osu-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/peppy/osu-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peppy/osu-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/peppy/osu-framework/languages","stargazers_url":"https://api.github.com/repos/peppy/osu-framework/stargazers","contributors_url":"https://api.github.com/repos/peppy/osu-framework/contributors","subscribers_url":"https://api.github.com/repos/peppy/osu-framework/subscribers","subscription_url":"https://api.github.com/repos/peppy/osu-framework/subscription","commits_url":"https://api.github.com/repos/peppy/osu-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/peppy/osu-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/peppy/osu-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/peppy/osu-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/peppy/osu-framework/contents/{+path}","compare_url":"https://api.github.com/repos/peppy/osu-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peppy/osu-framework/merges","archive_url":"https://api.github.com/repos/peppy/osu-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peppy/osu-framework/downloads","issues_url":"https://api.github.com/repos/peppy/osu-framework/issues{/number}","pulls_url":"https://api.github.com/repos/peppy/osu-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/peppy/osu-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/peppy/osu-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peppy/osu-framework/labels{/name}","releases_url":"https://api.github.com/repos/peppy/osu-framework/releases{/id}","deployments_url":"https://api.github.com/repos/peppy/osu-framework/deployments","created_at":"2016-08-29T04:12:29Z","updated_at":"2016-09-28T09:16:06Z","pushed_at":"2016-10-21T15:03:09Z","git_url":"git://github.com/peppy/osu-framework.git","ssh_url":"git@github.com:peppy/osu-framework.git","clone_url":"https://github.com/peppy/osu-framework.git","svn_url":"https://github.com/peppy/osu-framework","homepage":"","size":14011,"stargazers_count":1,"watchers_count":1,"language":"C#","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":1,"default_branch":"master"}},"base":{"label":"ppy:master","ref":"master","sha":"f394cfe19cea5f9629ff817dff66c1d80cdaaded","user":{"login":"ppy","id":995763,"avatar_url":"https://avatars.githubusercontent.com/u/995763?v=3","gravatar_id":"","url":"https://api.github.com/users/ppy","html_url":"https://github.com/ppy","followers_url":"https://api.github.com/users/ppy/followers","following_url":"https://api.github.com/users/ppy/following{/other_user}","gists_url":"https://api.github.com/users/ppy/gists{/gist_id}","starred_url":"https://api.github.com/users/ppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppy/subscriptions","organizations_url":"https://api.github.com/users/ppy/orgs","repos_url":"https://api.github.com/users/ppy/repos","events_url":"https://api.github.com/users/ppy/events{/privacy}","received_events_url":"https://api.github.com/users/ppy/received_events","type":"Organization","site_admin":false},"repo":{"id":66614524,"name":"osu-framework","full_name":"ppy/osu-framework","owner":{"login":"ppy","id":995763,"avatar_url":"https://avatars.githubusercontent.com/u/995763?v=3","gravatar_id":"","url":"https://api.github.com/users/ppy","html_url":"https://github.com/ppy","followers_url":"https://api.github.com/users/ppy/followers","following_url":"https://api.github.com/users/ppy/following{/other_user}","gists_url":"https://api.github.com/users/ppy/gists{/gist_id}","starred_url":"https://api.github.com/users/ppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppy/subscriptions","organizations_url":"https://api.github.com/users/ppy/orgs","repos_url":"https://api.github.com/users/ppy/repos","events_url":"https://api.github.com/users/ppy/events{/privacy}","received_events_url":"https://api.github.com/users/ppy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ppy/osu-framework","description":"A game framework written with osu! in mind.","fork":false,"url":"https://api.github.com/repos/ppy/osu-framework","forks_url":"https://api.github.com/repos/ppy/osu-framework/forks","keys_url":"https://api.github.com/repos/ppy/osu-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ppy/osu-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ppy/osu-framework/teams","hooks_url":"https://api.github.com/repos/ppy/osu-framework/hooks","issue_events_url":"https://api.github.com/repos/ppy/osu-framework/issues/events{/number}","events_url":"https://api.github.com/repos/ppy/osu-framework/events","assignees_url":"https://api.github.com/repos/ppy/osu-framework/assignees{/user}","branches_url":"https://api.github.com/repos/ppy/osu-framework/branches{/branch}","tags_url":"https://api.github.com/repos/ppy/osu-framework/tags","blobs_url":"https://api.github.com/repos/ppy/osu-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ppy/osu-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ppy/osu-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/ppy/osu-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ppy/osu-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/ppy/osu-framework/languages","stargazers_url":"https://api.github.com/repos/ppy/osu-framework/stargazers","contributors_url":"https://api.github.com/repos/ppy/osu-framework/contributors","subscribers_url":"https://api.github.com/repos/ppy/osu-framework/subscribers","subscription_url":"https://api.github.com/repos/ppy/osu-framework/subscription","commits_url":"https://api.github.com/repos/ppy/osu-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/ppy/osu-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/ppy/osu-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/ppy/osu-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/ppy/osu-framework/contents/{+path}","compare_url":"https://api.github.com/repos/ppy/osu-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ppy/osu-framework/merges","archive_url":"https://api.github.com/repos/ppy/osu-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ppy/osu-framework/downloads","issues_url":"https://api.github.com/repos/ppy/osu-framework/issues{/number}","pulls_url":"https://api.github.com/repos/ppy/osu-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/ppy/osu-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/ppy/osu-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ppy/osu-framework/labels{/name}","releases_url":"https://api.github.com/repos/ppy/osu-framework/releases{/id}","deployments_url":"https://api.github.com/repos/ppy/osu-framework/deployments","created_at":"2016-08-26T03:45:35Z","updated_at":"2016-10-12T17:45:33Z","pushed_at":"2016-10-21T15:03:10Z","git_url":"git://github.com/ppy/osu-framework.git","ssh_url":"git@github.com:ppy/osu-framework.git","clone_url":"https://github.com/ppy/osu-framework.git","svn_url":"https://github.com/ppy/osu-framework","homepage":"","size":14151,"stargazers_count":86,"watchers_count":86,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":37,"forks":37,"open_issues":37,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ppy/osu-framework/pulls/205"},"html":{"href":"https://github.com/ppy/osu-framework/pull/205"},"issue":{"href":"https://api.github.com/repos/ppy/osu-framework/issues/205"},"comments":{"href":"https://api.github.com/repos/ppy/osu-framework/issues/205/comments"},"review_comments":{"href":"https://api.github.com/repos/ppy/osu-framework/pulls/205/comments"},"review_comment":{"href":"https://api.github.com/repos/ppy/osu-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ppy/osu-framework/pulls/205/commits"},"statuses":{"href":"https://api.github.com/repos/ppy/osu-framework/statuses/90a5e4c95ee6efaef55202028c02910ea447f172"}}}}
{"actor":{"display_login":"peppy"}}