{"action":"created","comment":{"url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments/102734294","pull_request_review_id":23486763,"id":102734294,"diff_hunk":"@@ -0,0 +1,110 @@\n+/*\n+ * Copyright 2015-2017 EMBL - European Bioinformatics Institute\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package uk.ac.ebi.eva.runner;\n+\n+import org.junit.Assert;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.springframework.batch.core.Job;\n+import org.springframework.batch.core.JobExecution;\n+import org.springframework.batch.core.JobParameters;\n+import org.springframework.batch.core.launch.JobOperator;\n+import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;\n+import org.springframework.batch.test.JobLauncherTestUtils;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.test.annotation.DirtiesContext;\n+import org.springframework.test.context.ContextConfiguration;\n+import org.springframework.test.context.junit4.SpringRunner;\n+import uk.ac.ebi.eva.test.configuration.AsynchronousBatchTestConfiguration;\n+import uk.ac.ebi.eva.test.utils.AbstractJobRestartUtils;\n+\n+/**\n+ * Test to check launcher behaviour in Asynchronous cases.\n+ */\n+@RunWith(SpringRunner.class)\n+@ContextConfiguration(classes = {AsynchronousBatchTestConfiguration.class})\n+@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)\n+public class JobRestartAsynchronousTest extends AbstractJobRestartUtils {\n+\n+    // Wait until the job has been launched properly. The launch operation is not transactional, and other\n+    // instanciations of the same job with the same parameter can throw exceptions in this interval.\n+    public static final int INITIALIZE_JOB_SLEEP = 100;\n+    public static final int STEP_TIME_DURATION = 1000;\n+    public static final int WAIT_FOR_JOB_TO_END = 2000;\n+\n+    @Autowired\n+    private JobOperator jobOperator;\n+\n+    @Test(expected = JobExecutionAlreadyRunningException.class)\n+    public void runSameJobWhileExecutingThrowsException() throws Exception {\n+        JobLauncherTestUtils jobLauncherTestUtils = getJobLauncherTestUtils(getTestJob(\n+                getWaitingStep(false, STEP_TIME_DURATION)));\n+        launchJob(jobLauncherTestUtils);\n+        launchJob(jobLauncherTestUtils);\n+        Thread.sleep(WAIT_FOR_JOB_TO_END);\n+    }\n+\n+    @Test(expected = JobExecutionAlreadyRunningException.class)\n+    public void cantRunSecondJobEvenIfFirstIsStopped() throws Exception {\n+        JobLauncherTestUtils jobLauncherTestUtils = getJobLauncherTestUtils(getTestJob(\n+                getWaitingStep(false, STEP_TIME_DURATION)));\n+        JobExecution jobExecution = launchJob(jobLauncherTestUtils);\n+\n+        jobOperator.stop(jobExecution.getJobId());\n+        jobLauncherTestUtils.launchJob(new JobParameters());\n+        Thread.sleep(WAIT_FOR_JOB_TO_END);\n+    }\n+\n+    @Test\n+    public void jobStopedAndAbandonedCanBeStarted() throws Exception {\n+        JobLauncherTestUtils jobLauncherTestUtils = getJobLauncherTestUtils(getTestJob(\n+                getWaitingStep(false, STEP_TIME_DURATION)));\n+        JobExecution jobExecution = launchJob(jobLauncherTestUtils);\n+        jobOperator.stop(jobExecution.getJobId());\n+        jobOperator.abandon(jobExecution.getJobId());\n+        jobLauncherTestUtils.launchJob(new JobParameters());\n+        Thread.sleep(WAIT_FOR_JOB_TO_END);\n+    }\n+\n+    @Test\n+    public void abandonJobsRequireStepsMarkedAsRestartable() throws Exception {\n+        Job job = getTestJob(getQuickStep(false), getWaitingStep(false, STEP_TIME_DURATION));\n+        JobLauncherTestUtils jobLauncherTestUtils = getJobLauncherTestUtils(job);\n+        JobExecution jobExecution = launchJob(jobLauncherTestUtils);\n+        Thread.sleep(INITIALIZE_JOB_SLEEP);\n+        jobOperator.stop(jobExecution.getJobId());\n+        jobOperator.abandon(jobExecution.getJobId());\n+        Thread.sleep(WAIT_FOR_JOB_TO_END);\n+        jobExecution = launchJob(jobLauncherTestUtils);\n+        Thread.sleep(WAIT_FOR_JOB_TO_END);\n+        Assert.assertTrue(jobExecution.getStepExecutions().isEmpty());\n+    }\n+\n+    @Test\n+    public void abandonJobsWithMarkedAsRestartableRestartAllSteps() throws Exception {","path":"src/test/java/uk/ac/ebi/eva/runner/JobRestartAsynchronousTest.java","position":97,"original_position":97,"commit_id":"cfe6c131c4073a3d2a473300e964bb2c04d14950","original_commit_id":"a856d36f6e947a40847298be70cb3fc0024fd64d","user":{"login":"cyenyxe","id":1433407,"avatar_url":"https://avatars.githubusercontent.com/u/1433407?v=3","gravatar_id":"","url":"https://api.github.com/users/cyenyxe","html_url":"https://github.com/cyenyxe","followers_url":"https://api.github.com/users/cyenyxe/followers","following_url":"https://api.github.com/users/cyenyxe/following{/other_user}","gists_url":"https://api.github.com/users/cyenyxe/gists{/gist_id}","starred_url":"https://api.github.com/users/cyenyxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyenyxe/subscriptions","organizations_url":"https://api.github.com/users/cyenyxe/orgs","repos_url":"https://api.github.com/users/cyenyxe/repos","events_url":"https://api.github.com/users/cyenyxe/events{/privacy}","received_events_url":"https://api.github.com/users/cyenyxe/received_events","type":"User","site_admin":false},"body":"Then change it :stuck_out_tongue: ","created_at":"2017-02-23T15:15:02Z","updated_at":"2017-02-23T15:18:08Z","html_url":"https://github.com/EBIvariation/eva-pipeline/pull/90#discussion_r102734294","pull_request_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments/102734294"},"html":{"href":"https://github.com/EBIvariation/eva-pipeline/pull/90#discussion_r102734294"},"pull_request":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90","id":106759628,"html_url":"https://github.com/EBIvariation/eva-pipeline/pull/90","diff_url":"https://github.com/EBIvariation/eva-pipeline/pull/90.diff","patch_url":"https://github.com/EBIvariation/eva-pipeline/pull/90.patch","issue_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/90","number":90,"state":"open","locked":false,"title":"Eva 643 Spring Boot launcher to load JobParameters from properties file","user":{"login":"jorizci","id":13378840,"avatar_url":"https://avatars.githubusercontent.com/u/13378840?v=3","gravatar_id":"","url":"https://api.github.com/users/jorizci","html_url":"https://github.com/jorizci","followers_url":"https://api.github.com/users/jorizci/followers","following_url":"https://api.github.com/users/jorizci/following{/other_user}","gists_url":"https://api.github.com/users/jorizci/gists{/gist_id}","starred_url":"https://api.github.com/users/jorizci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorizci/subscriptions","organizations_url":"https://api.github.com/users/jorizci/orgs","repos_url":"https://api.github.com/users/jorizci/repos","events_url":"https://api.github.com/users/jorizci/events{/privacy}","received_events_url":"https://api.github.com/users/jorizci/received_events","type":"User","site_admin":false},"body":"-Addded new CLR.\r\n-Removed integration CLR.\r\n-Added tests for CLR.\r\n-Added ability to fully force a new job execution of all the steps from CL.\r\n-Fixed spring data mongo autowiring it's default bean.","created_at":"2017-02-17T15:56:52Z","updated_at":"2017-02-23T15:18:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32079a41d99bffe9ec35683d52310491516427bc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90/commits","review_comments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90/comments","review_comment_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/90/comments","statuses_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/statuses/cfe6c131c4073a3d2a473300e964bb2c04d14950","head":{"label":"jorizci:EVA-643","ref":"EVA-643","sha":"cfe6c131c4073a3d2a473300e964bb2c04d14950","user":{"login":"jorizci","id":13378840,"avatar_url":"https://avatars.githubusercontent.com/u/13378840?v=3","gravatar_id":"","url":"https://api.github.com/users/jorizci","html_url":"https://github.com/jorizci","followers_url":"https://api.github.com/users/jorizci/followers","following_url":"https://api.github.com/users/jorizci/following{/other_user}","gists_url":"https://api.github.com/users/jorizci/gists{/gist_id}","starred_url":"https://api.github.com/users/jorizci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorizci/subscriptions","organizations_url":"https://api.github.com/users/jorizci/orgs","repos_url":"https://api.github.com/users/jorizci/repos","events_url":"https://api.github.com/users/jorizci/events{/privacy}","received_events_url":"https://api.github.com/users/jorizci/received_events","type":"User","site_admin":false},"repo":{"id":66638363,"name":"eva-pipeline","full_name":"jorizci/eva-pipeline","owner":{"login":"jorizci","id":13378840,"avatar_url":"https://avatars.githubusercontent.com/u/13378840?v=3","gravatar_id":"","url":"https://api.github.com/users/jorizci","html_url":"https://github.com/jorizci","followers_url":"https://api.github.com/users/jorizci/followers","following_url":"https://api.github.com/users/jorizci/following{/other_user}","gists_url":"https://api.github.com/users/jorizci/gists{/gist_id}","starred_url":"https://api.github.com/users/jorizci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorizci/subscriptions","organizations_url":"https://api.github.com/users/jorizci/orgs","repos_url":"https://api.github.com/users/jorizci/repos","events_url":"https://api.github.com/users/jorizci/events{/privacy}","received_events_url":"https://api.github.com/users/jorizci/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jorizci/eva-pipeline","description":"Pipeline for the European Variation Archive, implemented using Luigi from Spotify (https://github.com/spotify/luigi)","fork":true,"url":"https://api.github.com/repos/jorizci/eva-pipeline","forks_url":"https://api.github.com/repos/jorizci/eva-pipeline/forks","keys_url":"https://api.github.com/repos/jorizci/eva-pipeline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jorizci/eva-pipeline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jorizci/eva-pipeline/teams","hooks_url":"https://api.github.com/repos/jorizci/eva-pipeline/hooks","issue_events_url":"https://api.github.com/repos/jorizci/eva-pipeline/issues/events{/number}","events_url":"https://api.github.com/repos/jorizci/eva-pipeline/events","assignees_url":"https://api.github.com/repos/jorizci/eva-pipeline/assignees{/user}","branches_url":"https://api.github.com/repos/jorizci/eva-pipeline/branches{/branch}","tags_url":"https://api.github.com/repos/jorizci/eva-pipeline/tags","blobs_url":"https://api.github.com/repos/jorizci/eva-pipeline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jorizci/eva-pipeline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jorizci/eva-pipeline/git/refs{/sha}","trees_url":"https://api.github.com/repos/jorizci/eva-pipeline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jorizci/eva-pipeline/statuses/{sha}","languages_url":"https://api.github.com/repos/jorizci/eva-pipeline/languages","stargazers_url":"https://api.github.com/repos/jorizci/eva-pipeline/stargazers","contributors_url":"https://api.github.com/repos/jorizci/eva-pipeline/contributors","subscribers_url":"https://api.github.com/repos/jorizci/eva-pipeline/subscribers","subscription_url":"https://api.github.com/repos/jorizci/eva-pipeline/subscription","commits_url":"https://api.github.com/repos/jorizci/eva-pipeline/commits{/sha}","git_commits_url":"https://api.github.com/repos/jorizci/eva-pipeline/git/commits{/sha}","comments_url":"https://api.github.com/repos/jorizci/eva-pipeline/comments{/number}","issue_comment_url":"https://api.github.com/repos/jorizci/eva-pipeline/issues/comments{/number}","contents_url":"https://api.github.com/repos/jorizci/eva-pipeline/contents/{+path}","compare_url":"https://api.github.com/repos/jorizci/eva-pipeline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jorizci/eva-pipeline/merges","archive_url":"https://api.github.com/repos/jorizci/eva-pipeline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jorizci/eva-pipeline/downloads","issues_url":"https://api.github.com/repos/jorizci/eva-pipeline/issues{/number}","pulls_url":"https://api.github.com/repos/jorizci/eva-pipeline/pulls{/number}","milestones_url":"https://api.github.com/repos/jorizci/eva-pipeline/milestones{/number}","notifications_url":"https://api.github.com/repos/jorizci/eva-pipeline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jorizci/eva-pipeline/labels{/name}","releases_url":"https://api.github.com/repos/jorizci/eva-pipeline/releases{/id}","deployments_url":"https://api.github.com/repos/jorizci/eva-pipeline/deployments","created_at":"2016-08-26T10:10:56Z","updated_at":"2016-08-26T10:10:57Z","pushed_at":"2017-02-23T15:10:30Z","git_url":"git://github.com/jorizci/eva-pipeline.git","ssh_url":"git@github.com:jorizci/eva-pipeline.git","clone_url":"https://github.com/jorizci/eva-pipeline.git","svn_url":"https://github.com/jorizci/eva-pipeline","homepage":"http://www.ebi.ac.uk/eva","size":2621,"stargazers_count":0,"watchers_count":0,"language":"Python","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":0,"default_branch":"master"}},"base":{"label":"EBIvariation:feature/job-parameters","ref":"feature/job-parameters","sha":"b451cfc4f59f40a6dfed9f0c3d5740a953763e88","user":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"repo":{"id":29298780,"name":"eva-pipeline","full_name":"EBIvariation/eva-pipeline","owner":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EBIvariation/eva-pipeline","description":"Genomic variation pipeline for the European Variation Archive, implemented using Spring Batch","fork":false,"url":"https://api.github.com/repos/EBIvariation/eva-pipeline","forks_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/forks","keys_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/teams","hooks_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/hooks","issue_events_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/events{/number}","events_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/events","assignees_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/assignees{/user}","branches_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/branches{/branch}","tags_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/tags","blobs_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/refs{/sha}","trees_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/statuses/{sha}","languages_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/languages","stargazers_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/stargazers","contributors_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/contributors","subscribers_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/subscribers","subscription_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/subscription","commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/commits{/sha}","git_commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/commits{/sha}","comments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/comments{/number}","issue_comment_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/comments{/number}","contents_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/contents/{+path}","compare_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/merges","archive_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/downloads","issues_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues{/number}","pulls_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls{/number}","milestones_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/milestones{/number}","notifications_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/labels{/name}","releases_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/releases{/id}","deployments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/deployments","created_at":"2015-01-15T13:34:10Z","updated_at":"2016-12-02T17:08:49Z","pushed_at":"2017-02-23T15:10:31Z","git_url":"git://github.com/EBIvariation/eva-pipeline.git","ssh_url":"git@github.com:EBIvariation/eva-pipeline.git","clone_url":"https://github.com/EBIvariation/eva-pipeline.git","svn_url":"https://github.com/EBIvariation/eva-pipeline","homepage":"http://www.ebi.ac.uk/eva","size":2524,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90"},"html":{"href":"https://github.com/EBIvariation/eva-pipeline/pull/90"},"issue":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/90"},"comments":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/statuses/cfe6c131c4073a3d2a473300e964bb2c04d14950"}}}}
{"actor":{"display_login":"cyenyxe"}}