Skip to content

LG-8886: Split percent logging for USPS proofing networking errors#8993

Merged
NavaTim merged 4 commits intomainfrom
lg-8886/handle-usps-network-errors
Aug 16, 2023
Merged

LG-8886: Split percent logging for USPS proofing networking errors#8993
NavaTim merged 4 commits intomainfrom
lg-8886/handle-usps-network-errors

Conversation

@NavaTim
Copy link
Contributor

@NavaTim NavaTim commented Aug 11, 2023

🎫 Ticket

  • LG-8886
    • This PR only includes a portion of the changes for this ticket.

🛠 Summary of changes

  • Log the percentage of networking errors for the USPS proofing results job separately from the percentage of other errors

📜 Testing Plan

  • Check that IPP is enabled and that the flag in_person_enrollments_ready_job_enabled is disabled
    • Note: This should work the same for GetUspsWaitingProofingResultsJob as for GetUspsProofingResultsJob if the flag is enabled. GetUspsReadyProofingResultsJob will only work for this test if the record already has the ready flag set.
  • Check that your local stack has usps_mock_fallback enabled
  • Create USPS enrollment (either with CLI tool or by completing in-person proofing flow)
    • bundle exec rails dev:random_in_person_users NUM_USERS='1' SCRYPT_COST='800$8$1$'
  • Update UspsInPersonProofing::Mock::Proofer.request_proofing_results to throw Faraday::TimeoutError
  • Run USPS proofing results job
    • rails c
    •  GetUspsProofingResultsJob.perform_now(Time.zone.now)
  • Check that log/events.log includes the GetUspsProofingResultsJob: Job completed with the following fields:
    • enrollments_network_error = 1
    • percent_enrollments_network_error = 100.00
    • enrollments_errored = 0
    • percent_enrollments_errored = 0.00
  • Update UspsInPersonProofing::Mock::Proofer.request_proofing_results to throw Faraday::ServerError
  • Run USPS proofing results job
    • rails c
    •  GetUspsProofingResultsJob.perform_now(Time.zone.now)
  • Check that log/events.log includes the GetUspsProofingResultsJob: Job completed with the following fields:
    • enrollments_network_error = 0
    • percent_enrollments_network_error = 0.00
    • enrollments_errored = 1
    • percent_enrollments_errored = 100.00

@NavaTim NavaTim requested review from a team and gina-yamada August 16, 2023 19:26
@racingspider
Copy link
Contributor

Pretty straight-forward. LGTM.

Copy link
Contributor

@racingspider racingspider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NavaTim NavaTim merged commit 58b0d61 into main Aug 16, 2023
@NavaTim NavaTim deleted the lg-8886/handle-usps-network-errors branch August 16, 2023 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants