{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/37565201","id":37565201,"diff_hunk":"@@ -0,0 +1,114 @@\n+/*\n+ * The MIT License\n+ *\n+ * Copyright 2015 CloudBees, Inc.\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+\n+package org.jvnet.hudson.main;\n+\n+import hudson.model.listeners.ItemListener;\n+import org.junit.Ignore;\n+import org.junit.Test;\n+import org.junit.Rule;\n+import org.jvnet.hudson.test.JenkinsRule;\n+import org.jvnet.hudson.test.TestExtension;\n+\n+public class JenkinsRuleTimeoutTest {\n+\n+    @Rule public JenkinsRule r = new JenkinsRule();\n+    {\n+        r.timeout = 10; // let us not wait three minutes!\n+    }\n+\n+    @Test public void hangInterruptiblyInTest() throws Exception {\n+        try {\n+            hangInterruptibly();\n+        } catch (InterruptedException x) {\n+            System.err.println(\"Interrupted, good.\");\n+        }\n+    }\n+\n+    @Ignore(\"TODO ought to use the idiom from org.junit.internal.runners.statements.FailOnTimeout: run test in its own thread so we can fail even if it does not respond to interruptions\")","path":"test/src/test/java/org/jvnet/hudson/main/JenkinsRuleTimeoutTest.java","position":49,"original_position":49,"commit_id":"2b0c04441386ed9842ebfa8f4751076fadda0d66","original_commit_id":"2b0c04441386ed9842ebfa8f4751076fadda0d66","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars.githubusercontent.com/u/154109?v=3","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"body":"My IDE has a line at 80 characters, which I ignore, because my screen can show more than 80 characters on a line, and anyway it wraps lines longer than that, so who cares?","created_at":"2015-08-20T18:36:19Z","updated_at":"2015-08-20T18:36:19Z","html_url":"https://github.com/jenkinsci/jenkins/pull/1809#discussion_r37565201","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/37565201"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1809#discussion_r37565201"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809","id":42955920,"html_url":"https://github.com/jenkinsci/jenkins/pull/1809","diff_url":"https://github.com/jenkinsci/jenkins/pull/1809.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/1809.patch","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1809","number":1809,"state":"open","locked":false,"title":"[JENKINS-28840] Cancel the test timer only after we call Jenkins.cleanUp, in case that hung","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars.githubusercontent.com/u/154109?v=3","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"body":"Might have rendered changes like https://github.com/jenkinsci/workflow-plugin/pull/184 unnecessary by making the test fail cleanly even if it hits a deadlock like [JENKINS-28840](https://issues.jenkins-ci.org/browse/JENKINS-28840); though in that case it is not clear to me that even interrupting the `cleanUp` thread would help, since `Queue._withLock` is using `lock` not `lockInterruptibly`. Left in a test case for a future improvement.\r\n\r\n(BTW @lordofthejars @kohsuke we should consider extracting `jenkinsci/jenkins/tree/master/test/src/main/` to a separate repository with its own release cycle where we can deliver fixes more quickly without being tied down to the core release cycle.)\r\n\r\n@reviewbybees","created_at":"2015-08-20T17:29:48Z","updated_at":"2015-08-20T18:36:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1072b6d655aafa327e484f74cf52788ba87afe6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1809/comments","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/2b0c04441386ed9842ebfa8f4751076fadda0d66","head":{"label":"jglick:JenkinsRule-timeout","ref":"JenkinsRule-timeout","sha":"2b0c04441386ed9842ebfa8f4751076fadda0d66","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars.githubusercontent.com/u/154109?v=3","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"repo":{"id":4914128,"name":"jenkins","full_name":"jglick/jenkins","owner":{"login":"jglick","id":154109,"avatar_url":"https://avatars.githubusercontent.com/u/154109?v=3","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jglick/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/jglick/jenkins","forks_url":"https://api.github.com/repos/jglick/jenkins/forks","keys_url":"https://api.github.com/repos/jglick/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jglick/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jglick/jenkins/teams","hooks_url":"https://api.github.com/repos/jglick/jenkins/hooks","issue_events_url":"https://api.github.com/repos/jglick/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/jglick/jenkins/events","assignees_url":"https://api.github.com/repos/jglick/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/jglick/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/jglick/jenkins/tags","blobs_url":"https://api.github.com/repos/jglick/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jglick/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jglick/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/jglick/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jglick/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/jglick/jenkins/languages","stargazers_url":"https://api.github.com/repos/jglick/jenkins/stargazers","contributors_url":"https://api.github.com/repos/jglick/jenkins/contributors","subscribers_url":"https://api.github.com/repos/jglick/jenkins/subscribers","subscription_url":"https://api.github.com/repos/jglick/jenkins/subscription","commits_url":"https://api.github.com/repos/jglick/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/jglick/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/jglick/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/jglick/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/jglick/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/jglick/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jglick/jenkins/merges","archive_url":"https://api.github.com/repos/jglick/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jglick/jenkins/downloads","issues_url":"https://api.github.com/repos/jglick/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/jglick/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/jglick/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/jglick/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jglick/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/jglick/jenkins/releases{/id}","created_at":"2012-07-05T19:53:26Z","updated_at":"2015-02-22T21:27:52Z","pushed_at":"2015-08-20T17:25:57Z","git_url":"git://github.com/jglick/jenkins.git","ssh_url":"git@github.com:jglick/jenkins.git","clone_url":"https://github.com/jglick/jenkins.git","svn_url":"https://github.com/jglick/jenkins","homepage":"http://jenkins-ci.org/","size":86209,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"jenkinsci:master","ref":"master","sha":"1d3b96205b4440b60ecd82f54c1f93596b1010ca","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1103607,"name":"jenkins","full_name":"jenkinsci/jenkins","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/jenkinsci/jenkins","forks_url":"https://api.github.com/repos/jenkinsci/jenkins/forks","keys_url":"https://api.github.com/repos/jenkinsci/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/jenkins/teams","hooks_url":"https://api.github.com/repos/jenkinsci/jenkins/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/jenkins/events","assignees_url":"https://api.github.com/repos/jenkinsci/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/jenkins/tags","blobs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/jenkins/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/jenkins/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/jenkins/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/jenkins/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/jenkins/subscription","commits_url":"https://api.github.com/repos/jenkinsci/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/jenkins/merges","archive_url":"https://api.github.com/repos/jenkinsci/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/jenkins/downloads","issues_url":"https://api.github.com/repos/jenkinsci/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/jenkins/releases{/id}","created_at":"2010-11-22T21:21:23Z","updated_at":"2015-08-20T15:59:32Z","pushed_at":"2015-08-20T17:29:48Z","git_url":"git://github.com/jenkinsci/jenkins.git","ssh_url":"git@github.com:jenkinsci/jenkins.git","clone_url":"https://github.com/jenkinsci/jenkins.git","svn_url":"https://github.com/jenkinsci/jenkins","homepage":"http://jenkins-ci.org/","size":449893,"stargazers_count":4434,"watchers_count":4434,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1964,"mirror_url":null,"open_issues_count":120,"forks":1964,"open_issues":120,"watchers":4434,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1809"},"issue":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1809"},"comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1809/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1809/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/jenkins/statuses/2b0c04441386ed9842ebfa8f4751076fadda0d66"}}}}