Skip to content
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

TDL-19176: Add backoff/retry for 5xx errors #115

Merged
merged 6 commits into from Jun 7, 2023

Conversation

hpatel41
Copy link
Contributor

Description of change

TDL-19176: Add backoff/retry for 5xx errors

  • Added backoff for 501 and 503 errors from the API doc
  • Also handled other 5XX errors not mentioned in the doc.

Manual QA steps

Risks

Rollback steps

  • revert this branch

@kethan1122 kethan1122 marked this pull request as ready for review May 31, 2023 04:24
@kethan1122 kethan1122 changed the base branch from crest-master to master May 31, 2023 04:47
# pipedrive object
pipedrive_tap = _tap.PipedriveTap(config, {})

def test_json_decode_successfull_with_200(self, mocked_jsondecode_successful_request, mocked_sleep):

Choose a reason for hiding this comment

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

Why is mocked_sleep passed in to all these functions?

Copy link
Contributor

@kethan1122 kethan1122 Jun 5, 2023

Choose a reason for hiding this comment

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

if you look at the code here, it has two decorators. each representing the parameters of the methods. by passing the mocked_sleep we are instructing the unit-test to skip the backoff time when encountering the exception. If we remove both mocked_sleep and its respective decorator then the unit-test will take time mentioned here to complete. So, we add the mocked_sleep and its decorator to skip the waiting time for unit-tests

Choose a reason for hiding this comment

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

Ah I see. Cool, sounds good to me. I'll approve.

@kethan1122 kethan1122 merged commit 69f0240 into master Jun 7, 2023
3 checks passed
@kethan1122 kethan1122 deleted the TDL-19176-add-backoff-for-5xx-errors branch June 7, 2023 04:50
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.

None yet

3 participants