{"action":"created","comment":{"url":"https://api.github.com/repos/DataTorrent/Netlet/pulls/comments/49647260","id":49647260,"diff_hunk":"@@ -127,16 +127,22 @@ public void sendData()\n   {\n   }\n \n-  @SuppressWarnings(\"SleepWhileInLoop\")\n-  private void verifySendReceive(final DefaultEventLoop el, final int port) throws IOException, InterruptedException\n+  @SuppressWarnings( {\"SleepWhileInLoop\", \"AssertEqualsBetweenInconvertibleTypes\"})\n+  private void verifySendReceive(final DefaultEventLoop el) throws IOException, InterruptedException\n   {\n     ServerImpl si = new ServerImpl();\n     ClientImpl ci = new ClientImpl();\n \n     new Thread(el).start();\n \n-    el.start(\"localhost\", port, si);\n-    el.connect(new InetSocketAddress(\"localhost\", port), ci);\n+    el.start(\"localhost\", 0, si);\n+    synchronized (si) {\n+      si.wait();\n+    }\n+    SocketAddress address = si.getServerAddress();\n+    logger.debug(\"Bound to address {}\", address);\n+    Assert.assertEquals(\"Inet Socket Created\", InetSocketAddress.class, address.getClass());\n+    el.connect((InetSocketAddress)address, ci);","path":"src/test/java/com/datatorrent/netlet/AbstractClientTest.java","position":23,"original_position":23,"commit_id":"5797a7df687c2bc729ae2a5a2fe9d65aeb910c22","original_commit_id":"5797a7df687c2bc729ae2a5a2fe9d65aeb910c22","user":{"login":"243826","id":2702787,"avatar_url":"https://avatars.githubusercontent.com/u/2702787?v=3","gravatar_id":"","url":"https://api.github.com/users/243826","html_url":"https://github.com/243826","followers_url":"https://api.github.com/users/243826/followers","following_url":"https://api.github.com/users/243826/following{/other_user}","gists_url":"https://api.github.com/users/243826/gists{/gist_id}","starred_url":"https://api.github.com/users/243826/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/243826/subscriptions","organizations_url":"https://api.github.com/users/243826/orgs","repos_url":"https://api.github.com/users/243826/repos","events_url":"https://api.github.com/users/243826/events{/privacy}","received_events_url":"https://api.github.com/users/243826/received_events","type":"User","site_admin":false},"body":"Yeah, makes sense.\n\nFrom: Vlad Rozov <notifications@github.com<mailto:notifications@github.com>>\nReply-To: DataTorrent/Netlet <reply@reply.github.com<mailto:reply@reply.github.com>>\nDate: Wednesday, January 13, 2016 at 7:32 AM\nTo: DataTorrent/Netlet <Netlet@noreply.github.com<mailto:Netlet@noreply.github.com>>\nCc: Chetan Narsude <chetan@apache.org<mailto:chetan@apache.org>>\nSubject: Re: [Netlet] make the tests pass by binding to available port as opposed to fixed … (#41)\n\n\nIn src/test/java/com/datatorrent/netlet/AbstractClientTest.java<https://github.com/DataTorrent/Netlet/pull/41#discussion_r49604375>:\n\n>    {\n>      ServerImpl si = new ServerImpl();\n>      ClientImpl ci = new ClientImpl();\n>\n>      new Thread(el).start();\n>\n> -    el.start(\"localhost\", port, si);\n> -    el.connect(new InetSocketAddress(\"localhost\", port), ci);\n> +    el.start(\"localhost\", 0, si);\n> +    synchronized (si) {\n> +      si.wait();\n> +    }\n> +    SocketAddress address = si.getServerAddress();\n> +    logger.debug(\"Bound to address {}\", address);\n> +    Assert.assertEquals(\"Inet Socket Created\", InetSocketAddress.class, address.getClass());\n> +    el.connect((InetSocketAddress)address, ci);\n\n\nel.connect() will log exception, will it be sufficient to reduce this to?\n\nel.connect((InetSocketAddress)si.getServerAddress(), ci);\n\n\n—\nReply to this email directly or view it on GitHub<https://github.com/DataTorrent/Netlet/pull/41/files#r49604375>.\n","created_at":"2016-01-13T20:41:20Z","updated_at":"2016-01-13T20:41:20Z","html_url":"https://github.com/DataTorrent/Netlet/pull/41#discussion_r49647260","pull_request_url":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/DataTorrent/Netlet/pulls/comments/49647260"},"html":{"href":"https://github.com/DataTorrent/Netlet/pull/41#discussion_r49647260"},"pull_request":{"href":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41","id":55848906,"html_url":"https://github.com/DataTorrent/Netlet/pull/41","diff_url":"https://github.com/DataTorrent/Netlet/pull/41.diff","patch_url":"https://github.com/DataTorrent/Netlet/pull/41.patch","issue_url":"https://api.github.com/repos/DataTorrent/Netlet/issues/41","number":41,"state":"open","locked":false,"title":"make the tests pass by binding to available port as opposed to fixed …","user":{"login":"243826","id":2702787,"avatar_url":"https://avatars.githubusercontent.com/u/2702787?v=3","gravatar_id":"","url":"https://api.github.com/users/243826","html_url":"https://github.com/243826","followers_url":"https://api.github.com/users/243826/followers","following_url":"https://api.github.com/users/243826/following{/other_user}","gists_url":"https://api.github.com/users/243826/gists{/gist_id}","starred_url":"https://api.github.com/users/243826/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/243826/subscriptions","organizations_url":"https://api.github.com/users/243826/orgs","repos_url":"https://api.github.com/users/243826/repos","events_url":"https://api.github.com/users/243826/events{/privacy}","received_events_url":"https://api.github.com/users/243826/received_events","type":"User","site_admin":false},"body":"…ports","created_at":"2016-01-13T02:59:19Z","updated_at":"2016-01-13T20:41:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efde7d39f72afda230e4ab2422c676a01f07197f","assignee":{"login":"vrozov","id":12200381,"avatar_url":"https://avatars.githubusercontent.com/u/12200381?v=3","gravatar_id":"","url":"https://api.github.com/users/vrozov","html_url":"https://github.com/vrozov","followers_url":"https://api.github.com/users/vrozov/followers","following_url":"https://api.github.com/users/vrozov/following{/other_user}","gists_url":"https://api.github.com/users/vrozov/gists{/gist_id}","starred_url":"https://api.github.com/users/vrozov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrozov/subscriptions","organizations_url":"https://api.github.com/users/vrozov/orgs","repos_url":"https://api.github.com/users/vrozov/repos","events_url":"https://api.github.com/users/vrozov/events{/privacy}","received_events_url":"https://api.github.com/users/vrozov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41/commits","review_comments_url":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41/comments","review_comment_url":"https://api.github.com/repos/DataTorrent/Netlet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataTorrent/Netlet/issues/41/comments","statuses_url":"https://api.github.com/repos/DataTorrent/Netlet/statuses/5797a7df687c2bc729ae2a5a2fe9d65aeb910c22","head":{"label":"243826:master","ref":"master","sha":"5797a7df687c2bc729ae2a5a2fe9d65aeb910c22","user":{"login":"243826","id":2702787,"avatar_url":"https://avatars.githubusercontent.com/u/2702787?v=3","gravatar_id":"","url":"https://api.github.com/users/243826","html_url":"https://github.com/243826","followers_url":"https://api.github.com/users/243826/followers","following_url":"https://api.github.com/users/243826/following{/other_user}","gists_url":"https://api.github.com/users/243826/gists{/gist_id}","starred_url":"https://api.github.com/users/243826/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/243826/subscriptions","organizations_url":"https://api.github.com/users/243826/orgs","repos_url":"https://api.github.com/users/243826/repos","events_url":"https://api.github.com/users/243826/events{/privacy}","received_events_url":"https://api.github.com/users/243826/received_events","type":"User","site_admin":false},"repo":{"id":38346110,"name":"Netlet","full_name":"243826/Netlet","owner":{"login":"243826","id":2702787,"avatar_url":"https://avatars.githubusercontent.com/u/2702787?v=3","gravatar_id":"","url":"https://api.github.com/users/243826","html_url":"https://github.com/243826","followers_url":"https://api.github.com/users/243826/followers","following_url":"https://api.github.com/users/243826/following{/other_user}","gists_url":"https://api.github.com/users/243826/gists{/gist_id}","starred_url":"https://api.github.com/users/243826/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/243826/subscriptions","organizations_url":"https://api.github.com/users/243826/orgs","repos_url":"https://api.github.com/users/243826/repos","events_url":"https://api.github.com/users/243826/events{/privacy}","received_events_url":"https://api.github.com/users/243826/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/243826/Netlet","description":"","fork":true,"url":"https://api.github.com/repos/243826/Netlet","forks_url":"https://api.github.com/repos/243826/Netlet/forks","keys_url":"https://api.github.com/repos/243826/Netlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/243826/Netlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/243826/Netlet/teams","hooks_url":"https://api.github.com/repos/243826/Netlet/hooks","issue_events_url":"https://api.github.com/repos/243826/Netlet/issues/events{/number}","events_url":"https://api.github.com/repos/243826/Netlet/events","assignees_url":"https://api.github.com/repos/243826/Netlet/assignees{/user}","branches_url":"https://api.github.com/repos/243826/Netlet/branches{/branch}","tags_url":"https://api.github.com/repos/243826/Netlet/tags","blobs_url":"https://api.github.com/repos/243826/Netlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/243826/Netlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/243826/Netlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/243826/Netlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/243826/Netlet/statuses/{sha}","languages_url":"https://api.github.com/repos/243826/Netlet/languages","stargazers_url":"https://api.github.com/repos/243826/Netlet/stargazers","contributors_url":"https://api.github.com/repos/243826/Netlet/contributors","subscribers_url":"https://api.github.com/repos/243826/Netlet/subscribers","subscription_url":"https://api.github.com/repos/243826/Netlet/subscription","commits_url":"https://api.github.com/repos/243826/Netlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/243826/Netlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/243826/Netlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/243826/Netlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/243826/Netlet/contents/{+path}","compare_url":"https://api.github.com/repos/243826/Netlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/243826/Netlet/merges","archive_url":"https://api.github.com/repos/243826/Netlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/243826/Netlet/downloads","issues_url":"https://api.github.com/repos/243826/Netlet/issues{/number}","pulls_url":"https://api.github.com/repos/243826/Netlet/pulls{/number}","milestones_url":"https://api.github.com/repos/243826/Netlet/milestones{/number}","notifications_url":"https://api.github.com/repos/243826/Netlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/243826/Netlet/labels{/name}","releases_url":"https://api.github.com/repos/243826/Netlet/releases{/id}","created_at":"2015-07-01T02:58:22Z","updated_at":"2016-01-13T02:57:45Z","pushed_at":"2016-01-13T03:03:04Z","git_url":"git://github.com/243826/Netlet.git","ssh_url":"git@github.com:243826/Netlet.git","clone_url":"https://github.com/243826/Netlet.git","svn_url":"https://github.com/243826/Netlet","homepage":null,"size":270,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"DataTorrent:master","ref":"master","sha":"89af32dcab409be5e76074a5ae2e5c3076695663","user":{"login":"DataTorrent","id":4400063,"avatar_url":"https://avatars.githubusercontent.com/u/4400063?v=3","gravatar_id":"","url":"https://api.github.com/users/DataTorrent","html_url":"https://github.com/DataTorrent","followers_url":"https://api.github.com/users/DataTorrent/followers","following_url":"https://api.github.com/users/DataTorrent/following{/other_user}","gists_url":"https://api.github.com/users/DataTorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/DataTorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataTorrent/subscriptions","organizations_url":"https://api.github.com/users/DataTorrent/orgs","repos_url":"https://api.github.com/users/DataTorrent/repos","events_url":"https://api.github.com/users/DataTorrent/events{/privacy}","received_events_url":"https://api.github.com/users/DataTorrent/received_events","type":"Organization","site_admin":false},"repo":{"id":37100513,"name":"Netlet","full_name":"DataTorrent/Netlet","owner":{"login":"DataTorrent","id":4400063,"avatar_url":"https://avatars.githubusercontent.com/u/4400063?v=3","gravatar_id":"","url":"https://api.github.com/users/DataTorrent","html_url":"https://github.com/DataTorrent","followers_url":"https://api.github.com/users/DataTorrent/followers","following_url":"https://api.github.com/users/DataTorrent/following{/other_user}","gists_url":"https://api.github.com/users/DataTorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/DataTorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataTorrent/subscriptions","organizations_url":"https://api.github.com/users/DataTorrent/orgs","repos_url":"https://api.github.com/users/DataTorrent/repos","events_url":"https://api.github.com/users/DataTorrent/events{/privacy}","received_events_url":"https://api.github.com/users/DataTorrent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataTorrent/Netlet","description":"","fork":false,"url":"https://api.github.com/repos/DataTorrent/Netlet","forks_url":"https://api.github.com/repos/DataTorrent/Netlet/forks","keys_url":"https://api.github.com/repos/DataTorrent/Netlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataTorrent/Netlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataTorrent/Netlet/teams","hooks_url":"https://api.github.com/repos/DataTorrent/Netlet/hooks","issue_events_url":"https://api.github.com/repos/DataTorrent/Netlet/issues/events{/number}","events_url":"https://api.github.com/repos/DataTorrent/Netlet/events","assignees_url":"https://api.github.com/repos/DataTorrent/Netlet/assignees{/user}","branches_url":"https://api.github.com/repos/DataTorrent/Netlet/branches{/branch}","tags_url":"https://api.github.com/repos/DataTorrent/Netlet/tags","blobs_url":"https://api.github.com/repos/DataTorrent/Netlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataTorrent/Netlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataTorrent/Netlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataTorrent/Netlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataTorrent/Netlet/statuses/{sha}","languages_url":"https://api.github.com/repos/DataTorrent/Netlet/languages","stargazers_url":"https://api.github.com/repos/DataTorrent/Netlet/stargazers","contributors_url":"https://api.github.com/repos/DataTorrent/Netlet/contributors","subscribers_url":"https://api.github.com/repos/DataTorrent/Netlet/subscribers","subscription_url":"https://api.github.com/repos/DataTorrent/Netlet/subscription","commits_url":"https://api.github.com/repos/DataTorrent/Netlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataTorrent/Netlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataTorrent/Netlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataTorrent/Netlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataTorrent/Netlet/contents/{+path}","compare_url":"https://api.github.com/repos/DataTorrent/Netlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataTorrent/Netlet/merges","archive_url":"https://api.github.com/repos/DataTorrent/Netlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataTorrent/Netlet/downloads","issues_url":"https://api.github.com/repos/DataTorrent/Netlet/issues{/number}","pulls_url":"https://api.github.com/repos/DataTorrent/Netlet/pulls{/number}","milestones_url":"https://api.github.com/repos/DataTorrent/Netlet/milestones{/number}","notifications_url":"https://api.github.com/repos/DataTorrent/Netlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataTorrent/Netlet/labels{/name}","releases_url":"https://api.github.com/repos/DataTorrent/Netlet/releases{/id}","created_at":"2015-06-09T00:27:01Z","updated_at":"2015-12-17T08:59:42Z","pushed_at":"2016-01-13T03:03:04Z","git_url":"git://github.com/DataTorrent/Netlet.git","ssh_url":"git@github.com:DataTorrent/Netlet.git","clone_url":"https://github.com/DataTorrent/Netlet.git","svn_url":"https://github.com/DataTorrent/Netlet","homepage":null,"size":306,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":5,"forks":8,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41"},"html":{"href":"https://github.com/DataTorrent/Netlet/pull/41"},"issue":{"href":"https://api.github.com/repos/DataTorrent/Netlet/issues/41"},"comments":{"href":"https://api.github.com/repos/DataTorrent/Netlet/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/DataTorrent/Netlet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataTorrent/Netlet/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/DataTorrent/Netlet/statuses/5797a7df687c2bc729ae2a5a2fe9d65aeb910c22"}}}}