{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-reef/pulls/comments/35007513","id":35007513,"diff_hunk":"@@ -118,19 +124,22 @@ public void testMultipleCloseCalls() throws Exception {\n     LoggingUtils.setLoggingLevel(Level.FINE);\n \n     final int numThreads = 3;\n+    final CountDownLatch eventCountLatch = new CountDownLatch(numThreads);\n+\n     final RuntimeClock clock = buildClock();\n     new Thread(clock).start();\n     final ThreadPoolStage<Alarm> stage = new ThreadPoolStage<>(new EventHandler<Alarm>() {\n       @Override\n       public void onNext(final Alarm value) {\n         clock.close();\n+        eventCountLatch.countDown();\n       }\n     }, numThreads);\n \n     try {\n       for (int i = 0; i < numThreads; ++i)\n         stage.onNext(null);\n-      Thread.sleep(1000);\n+      eventCountLatch.await(10, TimeUnit.SECONDS);","path":"lang/java/reef-wake/wake/src/test/java/org/apache/reef/wake/test/time/ClockTest.java","position":96,"original_position":96,"commit_id":"383178d4036dc29f21cf8b276929706b74abf6a2","original_commit_id":"383178d4036dc29f21cf8b276929706b74abf6a2","user":{"login":"dafrista","id":1514239,"avatar_url":"https://avatars.githubusercontent.com/u/1514239?v=3","gravatar_id":"","url":"https://api.github.com/users/dafrista","html_url":"https://github.com/dafrista","followers_url":"https://api.github.com/users/dafrista/followers","following_url":"https://api.github.com/users/dafrista/following{/other_user}","gists_url":"https://api.github.com/users/dafrista/gists{/gist_id}","starred_url":"https://api.github.com/users/dafrista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dafrista/subscriptions","organizations_url":"https://api.github.com/users/dafrista/orgs","repos_url":"https://api.github.com/users/dafrista/repos","events_url":"https://api.github.com/users/dafrista/events{/privacy}","received_events_url":"https://api.github.com/users/dafrista/received_events","type":"User","site_admin":false},"body":"If we wrap `assertTrue` on the latch, our test would make sure `clock.close()` doesn't hang.","created_at":"2015-07-20T15:31:29Z","updated_at":"2015-07-20T15:31:29Z","html_url":"https://github.com/apache/incubator-reef/pull/304#discussion_r35007513","pull_request_url":"https://api.github.com/repos/apache/incubator-reef/pulls/304","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/comments/35007513"},"html":{"href":"https://github.com/apache/incubator-reef/pull/304#discussion_r35007513"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/304"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-reef/pulls/304","id":40293538,"html_url":"https://github.com/apache/incubator-reef/pull/304","diff_url":"https://github.com/apache/incubator-reef/pull/304.diff","patch_url":"https://github.com/apache/incubator-reef/pull/304.patch","issue_url":"https://api.github.com/repos/apache/incubator-reef/issues/304","number":304,"state":"open","locked":false,"title":"[REEF-481] Make ClockTest predictable","user":{"login":"bgchun","id":359137,"avatar_url":"https://avatars.githubusercontent.com/u/359137?v=3","gravatar_id":"","url":"https://api.github.com/users/bgchun","html_url":"https://github.com/bgchun","followers_url":"https://api.github.com/users/bgchun/followers","following_url":"https://api.github.com/users/bgchun/following{/other_user}","gists_url":"https://api.github.com/users/bgchun/gists{/gist_id}","starred_url":"https://api.github.com/users/bgchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgchun/subscriptions","organizations_url":"https://api.github.com/users/bgchun/orgs","repos_url":"https://api.github.com/users/bgchun/repos","events_url":"https://api.github.com/users/bgchun/events{/privacy}","received_events_url":"https://api.github.com/users/bgchun/received_events","type":"User","site_admin":false},"body":"  This makes Clock tests more predictable by deleting removable Thread.sleep.\r\n\r\nJIRA:\r\n  [REEF-481](https://issues.apache.org/jira/browse/REEF-481)","created_at":"2015-07-18T15:19:53Z","updated_at":"2015-07-20T15:31:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6812fac9a1fb1436d13f649d03b8d2cadd47c93","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-reef/pulls/304/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-reef/pulls/304/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-reef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-reef/issues/304/comments","statuses_url":"https://api.github.com/repos/apache/incubator-reef/statuses/383178d4036dc29f21cf8b276929706b74abf6a2","head":{"label":"bgchun:REEF-481","ref":"REEF-481","sha":"383178d4036dc29f21cf8b276929706b74abf6a2","user":{"login":"bgchun","id":359137,"avatar_url":"https://avatars.githubusercontent.com/u/359137?v=3","gravatar_id":"","url":"https://api.github.com/users/bgchun","html_url":"https://github.com/bgchun","followers_url":"https://api.github.com/users/bgchun/followers","following_url":"https://api.github.com/users/bgchun/following{/other_user}","gists_url":"https://api.github.com/users/bgchun/gists{/gist_id}","starred_url":"https://api.github.com/users/bgchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgchun/subscriptions","organizations_url":"https://api.github.com/users/bgchun/orgs","repos_url":"https://api.github.com/users/bgchun/repos","events_url":"https://api.github.com/users/bgchun/events{/privacy}","received_events_url":"https://api.github.com/users/bgchun/received_events","type":"User","site_admin":false},"repo":{"id":27408633,"name":"incubator-reef","full_name":"bgchun/incubator-reef","owner":{"login":"bgchun","id":359137,"avatar_url":"https://avatars.githubusercontent.com/u/359137?v=3","gravatar_id":"","url":"https://api.github.com/users/bgchun","html_url":"https://github.com/bgchun","followers_url":"https://api.github.com/users/bgchun/followers","following_url":"https://api.github.com/users/bgchun/following{/other_user}","gists_url":"https://api.github.com/users/bgchun/gists{/gist_id}","starred_url":"https://api.github.com/users/bgchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgchun/subscriptions","organizations_url":"https://api.github.com/users/bgchun/orgs","repos_url":"https://api.github.com/users/bgchun/repos","events_url":"https://api.github.com/users/bgchun/events{/privacy}","received_events_url":"https://api.github.com/users/bgchun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bgchun/incubator-reef","description":"Mirror of Apache REEF (Incubating)","fork":true,"url":"https://api.github.com/repos/bgchun/incubator-reef","forks_url":"https://api.github.com/repos/bgchun/incubator-reef/forks","keys_url":"https://api.github.com/repos/bgchun/incubator-reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bgchun/incubator-reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bgchun/incubator-reef/teams","hooks_url":"https://api.github.com/repos/bgchun/incubator-reef/hooks","issue_events_url":"https://api.github.com/repos/bgchun/incubator-reef/issues/events{/number}","events_url":"https://api.github.com/repos/bgchun/incubator-reef/events","assignees_url":"https://api.github.com/repos/bgchun/incubator-reef/assignees{/user}","branches_url":"https://api.github.com/repos/bgchun/incubator-reef/branches{/branch}","tags_url":"https://api.github.com/repos/bgchun/incubator-reef/tags","blobs_url":"https://api.github.com/repos/bgchun/incubator-reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bgchun/incubator-reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bgchun/incubator-reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/bgchun/incubator-reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bgchun/incubator-reef/statuses/{sha}","languages_url":"https://api.github.com/repos/bgchun/incubator-reef/languages","stargazers_url":"https://api.github.com/repos/bgchun/incubator-reef/stargazers","contributors_url":"https://api.github.com/repos/bgchun/incubator-reef/contributors","subscribers_url":"https://api.github.com/repos/bgchun/incubator-reef/subscribers","subscription_url":"https://api.github.com/repos/bgchun/incubator-reef/subscription","commits_url":"https://api.github.com/repos/bgchun/incubator-reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/bgchun/incubator-reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/bgchun/incubator-reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/bgchun/incubator-reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/bgchun/incubator-reef/contents/{+path}","compare_url":"https://api.github.com/repos/bgchun/incubator-reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bgchun/incubator-reef/merges","archive_url":"https://api.github.com/repos/bgchun/incubator-reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bgchun/incubator-reef/downloads","issues_url":"https://api.github.com/repos/bgchun/incubator-reef/issues{/number}","pulls_url":"https://api.github.com/repos/bgchun/incubator-reef/pulls{/number}","milestones_url":"https://api.github.com/repos/bgchun/incubator-reef/milestones{/number}","notifications_url":"https://api.github.com/repos/bgchun/incubator-reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bgchun/incubator-reef/labels{/name}","releases_url":"https://api.github.com/repos/bgchun/incubator-reef/releases{/id}","created_at":"2014-12-02T01:17:26Z","updated_at":"2015-01-29T00:58:06Z","pushed_at":"2015-07-18T15:19:12Z","git_url":"git://github.com/bgchun/incubator-reef.git","ssh_url":"git@github.com:bgchun/incubator-reef.git","clone_url":"https://github.com/bgchun/incubator-reef.git","svn_url":"https://github.com/bgchun/incubator-reef","homepage":null,"size":29183,"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":"apache:master","ref":"master","sha":"60b9eb54bf47b6a0285d98276abb82eb703135b5","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":25623941,"name":"incubator-reef","full_name":"apache/incubator-reef","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-reef","description":"Mirror of Apache REEF (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-reef","forks_url":"https://api.github.com/repos/apache/incubator-reef/forks","keys_url":"https://api.github.com/repos/apache/incubator-reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-reef/teams","hooks_url":"https://api.github.com/repos/apache/incubator-reef/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-reef/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-reef/events","assignees_url":"https://api.github.com/repos/apache/incubator-reef/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-reef/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-reef/tags","blobs_url":"https://api.github.com/repos/apache/incubator-reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-reef/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-reef/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-reef/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-reef/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-reef/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-reef/subscription","commits_url":"https://api.github.com/repos/apache/incubator-reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-reef/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-reef/merges","archive_url":"https://api.github.com/repos/apache/incubator-reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-reef/downloads","issues_url":"https://api.github.com/repos/apache/incubator-reef/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-reef/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-reef/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-reef/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-reef/releases{/id}","created_at":"2014-10-23T07:00:10Z","updated_at":"2015-07-03T08:22:28Z","pushed_at":"2015-07-20T05:35:04Z","git_url":"git://github.com/apache/incubator-reef.git","ssh_url":"git@github.com:apache/incubator-reef.git","clone_url":"https://github.com/apache/incubator-reef.git","svn_url":"https://github.com/apache/incubator-reef","homepage":null,"size":42484,"stargazers_count":23,"watchers_count":23,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":30,"mirror_url":"git://git.apache.org/incubator-reef.git","open_issues_count":8,"forks":30,"open_issues":8,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/304"},"html":{"href":"https://github.com/apache/incubator-reef/pull/304"},"issue":{"href":"https://api.github.com/repos/apache/incubator-reef/issues/304"},"comments":{"href":"https://api.github.com/repos/apache/incubator-reef/issues/304/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/304/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-reef/pulls/304/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-reef/statuses/383178d4036dc29f21cf8b276929706b74abf6a2"}}}}