-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logging for submit 0781 job exhaustion #19433
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,44 @@ | |
end | ||
end | ||
end | ||
|
||
context 'when the API Provider uploads are enabled' do | ||
before do | ||
Flipper.enable(:disability_compensation_use_api_provider_for_0781_uploads) | ||
end | ||
|
||
let(:sidekiq_job_exhaustion_errors) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also a nit, this is more like |
||
{ | ||
'jid' => form526_job_status.job_id, | ||
'error_class' => 'Broken Job Error', | ||
'error_message' => 'Your Job Broke', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol |
||
'args' => [form526_submission.id] | ||
} | ||
end | ||
|
||
context 'for a Lighthouse upload' do | ||
it 'logs the job failure' do | ||
Flipper.enable(:disability_compensation_upload_0781_to_lighthouse) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally optional style not but I like these in a before block under the context block, as it sets up all the tests for this context and if we add more it will make that easier. Super nitpicky though |
||
|
||
subject.within_sidekiq_retries_exhausted_block(sidekiq_job_exhaustion_errors) do | ||
expect_any_instance_of(LighthouseSupplementalDocumentUploadProvider) | ||
.to receive(:log_uploading_job_failure) | ||
.with(EVSS::DisabilityCompensationForm::SubmitForm0781, 'Broken Job Error', 'Your Job Broke') | ||
end | ||
end | ||
end | ||
|
||
context 'for an EVSS Upload' do | ||
it 'logs the job failure' do | ||
Flipper.disable(:disability_compensation_upload_0781_to_lighthouse) | ||
|
||
subject.within_sidekiq_retries_exhausted_block(sidekiq_job_exhaustion_errors) do | ||
expect_any_instance_of(EVSSSupplementalDocumentUploadProvider).to receive(:log_uploading_job_failure) | ||
.with(EVSS::DisabilityCompensationForm::SubmitForm0781, 'Broken Job Error', 'Your Job Broke') | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bahhh that's right we don't know which form actually failed here (0781 or 0781a) but since we're logging the same metric regardless and logging the actual error below it doesn't matter, so I think this is totally fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was my thinking as well. If we need to dig into the error more, we can find the form type on the submission.