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: add InternalServerError to list of expected errors #151

Merged
merged 2 commits into from Jan 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/system/test_system.py
Expand Up @@ -20,6 +20,7 @@

from google.api_core.exceptions import BadGateway
from google.api_core.exceptions import Conflict
from google.api_core.exceptions import InternalServerError
from google.api_core.exceptions import NotFound
from google.api_core.exceptions import TooManyRequests
from google.api_core.exceptions import ResourceExhausted
Expand Down Expand Up @@ -67,7 +68,9 @@ def _list_entries(logger):
:returns: List of all entries consumed.
"""
inner = RetryResult(_has_entries, max_tries=9)(_consume_entries)
outer = RetryErrors((ServiceUnavailable, ResourceExhausted), max_tries=9)(inner)
outer = RetryErrors(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is OK for the purposes of tests. For any changes to automatic retries in the client make sure to reference https://google.aip.dev/194 (it has guidance on error codes that should/shouldn't be retried).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know, thanks!

(ServiceUnavailable, ResourceExhausted, InternalServerError), max_tries=9
)(inner)
return outer(logger)


Expand Down