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

fix: fix check for 'internal_failure' condition #387

Merged
merged 2 commits into from
Nov 13, 2019

Conversation

georgysavva
Copy link
Contributor

As I was saying in this comment
In some cases response doesn't contain error_description field. So the retry won't work. The solution is to look at both error and error_description fields.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Nov 13, 2019
@georgysavva
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Nov 13, 2019
@georgysavva georgysavva changed the title fix 'internal_failure' condition Fix 'internal_failure' condition Nov 13, 2019
…e `error' field

In some cases response doesn't contain error_description field. So the retry won't work. The solution is to look at both error and error_description fields.
Copy link

@software-dov software-dov left a comment

Choose a reason for hiding this comment

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

This changes the test coverage: in test__token_endpoint_request_internal_failure_error, the first check should only have "error_description" set. Otherwise looks good.

Now test__token_endpoint_request_internal_failure_error contains two mutually exclusive cases.
Copy link

@software-dov software-dov left a comment

Choose a reason for hiding this comment

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

LGTM. Test could be refactored to loop over "error" and "error_description", but it's fine as is.

@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 13, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 13, 2019
@busunkim96 busunkim96 changed the title Fix 'internal_failure' condition fix: fix check for 'internal_failure' condition Nov 13, 2019
@georgysavva
Copy link
Contributor Author

georgysavva commented Nov 13, 2019

Fixed the test

@busunkim96
Copy link
Contributor

@georgysavva Thank you for submitting a patch!

@ziliangpeng
Copy link

@georgysavva Do you think it's possible that, sometimes if we get errors from the server, the response will not be in json format, thus loading json from the response before checking ok would cause exception?

@georgysavva
Copy link
Contributor Author

@ziliangpeng totally makes sense. Should be a good improvement. Fill free to open a PR with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants