{"action":"created","comment":{"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/comments/44088212","id":44088212,"diff_hunk":"@@ -311,6 +312,27 @@ public Integer call() throws Exception {\n   }\n \n   @Test\n+  public void testBackgroundCallWaitingWithTimeouts() throws Exception {\n+    final Object sync = new Object();\n+\n+    Task<Integer> task = Task.callInBackground(new Callable<Integer>() {\n+      public Integer call() throws Exception {\n+        synchronized (sync) {\n+          sync.wait();\n+        }\n+        return 5;\n+      }\n+    });\n+    assertFalse(task.waitForCompletion(100, TimeUnit.MILLISECONDS));\n+    synchronized (sync) {\n+      sync.notify();\n+    }\n+    task.waitForCompletion();\n+    assertTrue(task.waitForCompletion(100, TimeUnit.MILLISECONDS));\n+    assertEquals(5, task.getResult().intValue());\n+  }","path":"bolts-tasks/src/test/java/bolts/TaskTest.java","position":30,"original_position":30,"commit_id":"ece1ebd5531461b41b7961ee3a5de58a2bc8e026","original_commit_id":"ece1ebd5531461b41b7961ee3a5de58a2bc8e026","user":{"login":"grantland","id":277030,"avatar_url":"https://avatars.githubusercontent.com/u/277030?v=3","gravatar_id":"","url":"https://api.github.com/users/grantland","html_url":"https://github.com/grantland","followers_url":"https://api.github.com/users/grantland/followers","following_url":"https://api.github.com/users/grantland/following{/other_user}","gists_url":"https://api.github.com/users/grantland/gists{/gist_id}","starred_url":"https://api.github.com/users/grantland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantland/subscriptions","organizations_url":"https://api.github.com/users/grantland/orgs","repos_url":"https://api.github.com/users/grantland/repos","events_url":"https://api.github.com/users/grantland/events{/privacy}","received_events_url":"https://api.github.com/users/grantland/received_events","type":"User","site_admin":false},"body":"It looks like we'd want to verify the third code path where task.waitForCompletion returns true if it isn't already completed when calling it.","created_at":"2015-11-06T00:05:02Z","updated_at":"2015-11-06T00:05:02Z","html_url":"https://github.com/BoltsFramework/Bolts-Android/pull/99#discussion_r44088212","pull_request_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/comments/44088212"},"html":{"href":"https://github.com/BoltsFramework/Bolts-Android/pull/99#discussion_r44088212"},"pull_request":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99","id":49876031,"html_url":"https://github.com/BoltsFramework/Bolts-Android/pull/99","diff_url":"https://github.com/BoltsFramework/Bolts-Android/pull/99.diff","patch_url":"https://github.com/BoltsFramework/Bolts-Android/pull/99.patch","issue_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/99","number":99,"state":"open","locked":false,"title":"Support partial waits","user":{"login":"stefanrusek","id":58397,"avatar_url":"https://avatars.githubusercontent.com/u/58397?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanrusek","html_url":"https://github.com/stefanrusek","followers_url":"https://api.github.com/users/stefanrusek/followers","following_url":"https://api.github.com/users/stefanrusek/following{/other_user}","gists_url":"https://api.github.com/users/stefanrusek/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanrusek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanrusek/subscriptions","organizations_url":"https://api.github.com/users/stefanrusek/orgs","repos_url":"https://api.github.com/users/stefanrusek/repos","events_url":"https://api.github.com/users/stefanrusek/events{/privacy}","received_events_url":"https://api.github.com/users/stefanrusek/received_events","type":"User","site_admin":false},"body":"Add an overload to waitForCompletion() that takes a timeout.","created_at":"2015-11-05T20:27:57Z","updated_at":"2015-11-06T00:05:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d07e460733f6c2526ff8c9f02290bf308538752c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99/commits","review_comments_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99/comments","review_comment_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/99/comments","statuses_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/statuses/ece1ebd5531461b41b7961ee3a5de58a2bc8e026","head":{"label":"roverdotcom:waitWithTimeout","ref":"waitWithTimeout","sha":"ece1ebd5531461b41b7961ee3a5de58a2bc8e026","user":{"login":"roverdotcom","id":1463288,"avatar_url":"https://avatars.githubusercontent.com/u/1463288?v=3","gravatar_id":"","url":"https://api.github.com/users/roverdotcom","html_url":"https://github.com/roverdotcom","followers_url":"https://api.github.com/users/roverdotcom/followers","following_url":"https://api.github.com/users/roverdotcom/following{/other_user}","gists_url":"https://api.github.com/users/roverdotcom/gists{/gist_id}","starred_url":"https://api.github.com/users/roverdotcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roverdotcom/subscriptions","organizations_url":"https://api.github.com/users/roverdotcom/orgs","repos_url":"https://api.github.com/users/roverdotcom/repos","events_url":"https://api.github.com/users/roverdotcom/events{/privacy}","received_events_url":"https://api.github.com/users/roverdotcom/received_events","type":"Organization","site_admin":false},"repo":{"id":45628777,"name":"Bolts-Android","full_name":"roverdotcom/Bolts-Android","owner":{"login":"roverdotcom","id":1463288,"avatar_url":"https://avatars.githubusercontent.com/u/1463288?v=3","gravatar_id":"","url":"https://api.github.com/users/roverdotcom","html_url":"https://github.com/roverdotcom","followers_url":"https://api.github.com/users/roverdotcom/followers","following_url":"https://api.github.com/users/roverdotcom/following{/other_user}","gists_url":"https://api.github.com/users/roverdotcom/gists{/gist_id}","starred_url":"https://api.github.com/users/roverdotcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roverdotcom/subscriptions","organizations_url":"https://api.github.com/users/roverdotcom/orgs","repos_url":"https://api.github.com/users/roverdotcom/repos","events_url":"https://api.github.com/users/roverdotcom/events{/privacy}","received_events_url":"https://api.github.com/users/roverdotcom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/roverdotcom/Bolts-Android","description":"Bolts is a collection of low-level libraries designed to make developing mobile apps easier.","fork":true,"url":"https://api.github.com/repos/roverdotcom/Bolts-Android","forks_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/forks","keys_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/teams","hooks_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/hooks","issue_events_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/issues/events{/number}","events_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/events","assignees_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/assignees{/user}","branches_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/branches{/branch}","tags_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/tags","blobs_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/languages","stargazers_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/stargazers","contributors_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/contributors","subscribers_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/subscribers","subscription_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/subscription","commits_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/contents/{+path}","compare_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/merges","archive_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/downloads","issues_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/issues{/number}","pulls_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/labels{/name}","releases_url":"https://api.github.com/repos/roverdotcom/Bolts-Android/releases{/id}","created_at":"2015-11-05T17:47:31Z","updated_at":"2015-11-05T18:23:32Z","pushed_at":"2015-11-05T21:13:13Z","git_url":"git://github.com/roverdotcom/Bolts-Android.git","ssh_url":"git@github.com:roverdotcom/Bolts-Android.git","clone_url":"https://github.com/roverdotcom/Bolts-Android.git","svn_url":"https://github.com/roverdotcom/Bolts-Android","homepage":"http://boltsframework.github.io/docs/android","size":1301,"stargazers_count":1,"watchers_count":1,"language":"Java","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":"BoltsFramework:master","ref":"master","sha":"c067c004d78618fdc4cfcd305818f13681eb32e6","user":{"login":"BoltsFramework","id":6530429,"avatar_url":"https://avatars.githubusercontent.com/u/6530429?v=3","gravatar_id":"","url":"https://api.github.com/users/BoltsFramework","html_url":"https://github.com/BoltsFramework","followers_url":"https://api.github.com/users/BoltsFramework/followers","following_url":"https://api.github.com/users/BoltsFramework/following{/other_user}","gists_url":"https://api.github.com/users/BoltsFramework/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltsFramework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltsFramework/subscriptions","organizations_url":"https://api.github.com/users/BoltsFramework/orgs","repos_url":"https://api.github.com/users/BoltsFramework/repos","events_url":"https://api.github.com/users/BoltsFramework/events{/privacy}","received_events_url":"https://api.github.com/users/BoltsFramework/received_events","type":"Organization","site_admin":false},"repo":{"id":16368712,"name":"Bolts-Android","full_name":"BoltsFramework/Bolts-Android","owner":{"login":"BoltsFramework","id":6530429,"avatar_url":"https://avatars.githubusercontent.com/u/6530429?v=3","gravatar_id":"","url":"https://api.github.com/users/BoltsFramework","html_url":"https://github.com/BoltsFramework","followers_url":"https://api.github.com/users/BoltsFramework/followers","following_url":"https://api.github.com/users/BoltsFramework/following{/other_user}","gists_url":"https://api.github.com/users/BoltsFramework/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltsFramework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltsFramework/subscriptions","organizations_url":"https://api.github.com/users/BoltsFramework/orgs","repos_url":"https://api.github.com/users/BoltsFramework/repos","events_url":"https://api.github.com/users/BoltsFramework/events{/privacy}","received_events_url":"https://api.github.com/users/BoltsFramework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BoltsFramework/Bolts-Android","description":"Bolts is a collection of low-level libraries designed to make developing mobile apps easier.","fork":false,"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android","forks_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/forks","keys_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/teams","hooks_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/hooks","issue_events_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/events{/number}","events_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/events","assignees_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/assignees{/user}","branches_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/branches{/branch}","tags_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/tags","blobs_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/languages","stargazers_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/stargazers","contributors_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/contributors","subscribers_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/subscribers","subscription_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/subscription","commits_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/contents/{+path}","compare_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/merges","archive_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/downloads","issues_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues{/number}","pulls_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/labels{/name}","releases_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/releases{/id}","created_at":"2014-01-30T04:58:14Z","updated_at":"2015-11-05T13:26:23Z","pushed_at":"2015-11-05T21:14:00Z","git_url":"git://github.com/BoltsFramework/Bolts-Android.git","ssh_url":"git@github.com:BoltsFramework/Bolts-Android.git","clone_url":"https://github.com/BoltsFramework/Bolts-Android.git","svn_url":"https://github.com/BoltsFramework/Bolts-Android","homepage":"http://boltsframework.github.io/docs/android","size":1301,"stargazers_count":2196,"watchers_count":2196,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":314,"mirror_url":null,"open_issues_count":12,"forks":314,"open_issues":12,"watchers":2196,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99"},"html":{"href":"https://github.com/BoltsFramework/Bolts-Android/pull/99"},"issue":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/99"},"comments":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/BoltsFramework/Bolts-Android/statuses/ece1ebd5531461b41b7961ee3a5de58a2bc8e026"}}}}