{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/notifications-api/pulls/comments/145042435","pull_request_review_id":69776137,"id":145042435,"diff_hunk":"@@ -1204,3 +1210,161 @@ def test_send_inbound_sms_to_service_does_not_retries_if_request_returns_404(not\n         send_inbound_sms_to_service(inbound_sms.id, inbound_sms.service_id)\n \n     mocked.call_count == 0\n+\n+\n+def test_check_job_status_task_does_not_raise_error(sample_template):\n+    job = create_job(template=sample_template, notification_count=3,\n+                     created_at=datetime.utcnow() - timedelta(hours=2),\n+                     scheduled_for=datetime.utcnow() - timedelta(minutes=31),\n+                     processing_started=datetime.utcnow() - timedelta(minutes=31),\n+                     job_status=JOB_STATUS_FINISHED)\n+    job_2 = create_job(template=sample_template, notification_count=3,\n+                       created_at=datetime.utcnow() - timedelta(minutes=31),\n+                       processing_started=datetime.utcnow() - timedelta(minutes=31),\n+                       job_status=JOB_STATUS_FINISHED)\n+\n+    check_job_status()\n+\n+\n+def test_process_incomplete_job(mocker, sample_template):\n+\n+    mocker.patch('app.celery.tasks.s3.get_job_from_s3', return_value=load_example_csv('multiple_sms'))\n+    send_sms = mocker.patch('app.celery.tasks.send_sms.apply_async')\n+\n+    job = create_job(template=sample_template, notification_count=3,","path":"tests/app/celery/test_tasks.py","position":74,"original_position":74,"commit_id":"0ff80bcb76c03c688288239343f3de9275a57e8e","original_commit_id":"0ff80bcb76c03c688288239343f3de9275a57e8e","user":{"login":"kentsanggds","id":22152807,"avatar_url":"https://avatars1.githubusercontent.com/u/22152807?v=4","gravatar_id":"","url":"https://api.github.com/users/kentsanggds","html_url":"https://github.com/kentsanggds","followers_url":"https://api.github.com/users/kentsanggds/followers","following_url":"https://api.github.com/users/kentsanggds/following{/other_user}","gists_url":"https://api.github.com/users/kentsanggds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentsanggds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentsanggds/subscriptions","organizations_url":"https://api.github.com/users/kentsanggds/orgs","repos_url":"https://api.github.com/users/kentsanggds/repos","events_url":"https://api.github.com/users/kentsanggds/events{/privacy}","received_events_url":"https://api.github.com/users/kentsanggds/received_events","type":"User","site_admin":false},"body":"Shouldn't the `notification_count` be 10 here and not 3? \r\nUpdate the test to make more sense.","created_at":"2017-10-17T07:06:45Z","updated_at":"2017-10-17T07:18:09Z","html_url":"https://github.com/alphagov/notifications-api/pull/1313#discussion_r145042435","pull_request_url":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/comments/145042435"},"html":{"href":"https://github.com/alphagov/notifications-api/pull/1313#discussion_r145042435"},"pull_request":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313","id":146762349,"html_url":"https://github.com/alphagov/notifications-api/pull/1313","diff_url":"https://github.com/alphagov/notifications-api/pull/1313.diff","patch_url":"https://github.com/alphagov/notifications-api/pull/1313.patch","issue_url":"https://api.github.com/repos/alphagov/notifications-api/issues/1313","number":1313,"state":"open","locked":false,"title":" Process Incomplete Jobs","user":{"login":"richardc0","id":31849076,"avatar_url":"https://avatars3.githubusercontent.com/u/31849076?v=4","gravatar_id":"","url":"https://api.github.com/users/richardc0","html_url":"https://github.com/richardc0","followers_url":"https://api.github.com/users/richardc0/followers","following_url":"https://api.github.com/users/richardc0/following{/other_user}","gists_url":"https://api.github.com/users/richardc0/gists{/gist_id}","starred_url":"https://api.github.com/users/richardc0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardc0/subscriptions","organizations_url":"https://api.github.com/users/richardc0/orgs","repos_url":"https://api.github.com/users/richardc0/repos","events_url":"https://api.github.com/users/richardc0/events{/privacy}","received_events_url":"https://api.github.com/users/richardc0/received_events","type":"User","site_admin":false},"body":"- Added a new task to process incomplete jobs\r\n- Added tests to test the new task\r\n- Updated the check for incomplete jobs method to start the new task if incomplete jobs are found.\r\n\r\nThis will effectively resume tasks which for some reason were interrupted\r\nwhilst they were being processed e.g. if the application unintentionally restarted. In some cases only some of the csv is processed, this will find the place in the csv and continue processing the job from that point and mark the job as complete.","created_at":"2017-10-16T11:40:48Z","updated_at":"2017-10-17T07:18:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5719ffb0b45cc2d36c1636166bf114eda6d7257","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313/commits","review_comments_url":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313/comments","review_comment_url":"https://api.github.com/repos/alphagov/notifications-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/notifications-api/issues/1313/comments","statuses_url":"https://api.github.com/repos/alphagov/notifications-api/statuses/0ff80bcb76c03c688288239343f3de9275a57e8e","head":{"label":"alphagov:rc_process_missing_rows_in_csv","ref":"rc_process_missing_rows_in_csv","sha":"0ff80bcb76c03c688288239343f3de9275a57e8e","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46422101,"name":"notifications-api","full_name":"alphagov/notifications-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/notifications-api","description":"Notifications api","fork":false,"url":"https://api.github.com/repos/alphagov/notifications-api","forks_url":"https://api.github.com/repos/alphagov/notifications-api/forks","keys_url":"https://api.github.com/repos/alphagov/notifications-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/notifications-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/notifications-api/teams","hooks_url":"https://api.github.com/repos/alphagov/notifications-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/notifications-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/notifications-api/events","assignees_url":"https://api.github.com/repos/alphagov/notifications-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/notifications-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/notifications-api/tags","blobs_url":"https://api.github.com/repos/alphagov/notifications-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/notifications-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/notifications-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/notifications-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/notifications-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/notifications-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/notifications-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/notifications-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/notifications-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/notifications-api/subscription","commits_url":"https://api.github.com/repos/alphagov/notifications-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/notifications-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/notifications-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/notifications-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/notifications-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/notifications-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/notifications-api/merges","archive_url":"https://api.github.com/repos/alphagov/notifications-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/notifications-api/downloads","issues_url":"https://api.github.com/repos/alphagov/notifications-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/notifications-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/notifications-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/notifications-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/notifications-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/notifications-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/notifications-api/deployments","created_at":"2015-11-18T13:57:17Z","updated_at":"2017-05-24T16:00:23Z","pushed_at":"2017-10-16T16:33:26Z","git_url":"git://github.com/alphagov/notifications-api.git","ssh_url":"git@github.com:alphagov/notifications-api.git","clone_url":"https://github.com/alphagov/notifications-api.git","svn_url":"https://github.com/alphagov/notifications-api","homepage":null,"size":14514,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":8,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"e32350967e09e97dd26d8c3849f3cf62636019d1","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46422101,"name":"notifications-api","full_name":"alphagov/notifications-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/notifications-api","description":"Notifications api","fork":false,"url":"https://api.github.com/repos/alphagov/notifications-api","forks_url":"https://api.github.com/repos/alphagov/notifications-api/forks","keys_url":"https://api.github.com/repos/alphagov/notifications-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/notifications-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/notifications-api/teams","hooks_url":"https://api.github.com/repos/alphagov/notifications-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/notifications-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/notifications-api/events","assignees_url":"https://api.github.com/repos/alphagov/notifications-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/notifications-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/notifications-api/tags","blobs_url":"https://api.github.com/repos/alphagov/notifications-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/notifications-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/notifications-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/notifications-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/notifications-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/notifications-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/notifications-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/notifications-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/notifications-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/notifications-api/subscription","commits_url":"https://api.github.com/repos/alphagov/notifications-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/notifications-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/notifications-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/notifications-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/notifications-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/notifications-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/notifications-api/merges","archive_url":"https://api.github.com/repos/alphagov/notifications-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/notifications-api/downloads","issues_url":"https://api.github.com/repos/alphagov/notifications-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/notifications-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/notifications-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/notifications-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/notifications-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/notifications-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/notifications-api/deployments","created_at":"2015-11-18T13:57:17Z","updated_at":"2017-05-24T16:00:23Z","pushed_at":"2017-10-16T16:33:26Z","git_url":"git://github.com/alphagov/notifications-api.git","ssh_url":"git@github.com:alphagov/notifications-api.git","clone_url":"https://github.com/alphagov/notifications-api.git","svn_url":"https://github.com/alphagov/notifications-api","homepage":null,"size":14514,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313"},"html":{"href":"https://github.com/alphagov/notifications-api/pull/1313"},"issue":{"href":"https://api.github.com/repos/alphagov/notifications-api/issues/1313"},"comments":{"href":"https://api.github.com/repos/alphagov/notifications-api/issues/1313/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/1313/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/notifications-api/statuses/0ff80bcb76c03c688288239343f3de9275a57e8e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kentsanggds"}}