-
Notifications
You must be signed in to change notification settings - Fork 308
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 retry to google.auth.compute_engine._metadata.get()
#398
fix: add retry to google.auth.compute_engine._metadata.get()
#398
Conversation
e0c2dbd
to
917df1a
Compare
cc @busunkim96 @DaniilAnichin I am no longer maintaining this library. Cheers |
917df1a
to
1226931
Compare
1226931
to
2f75de9
Compare
I can't tell who the maintainers currently are, but @theacodes or @busunkim96, would you be available to review this? It's caused us a few headaches so far (right now we're wrapping all our gets in our own retry logic). Thanks! |
@lucasmbrown Thank you for the ping! I missed this PR. I'll take a look now. |
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.
It looks like there's a mismatch between the actual retry count (5) and the count in the test (3). Otherwise this looks good to me. Thank you for the PR!
=================================== FAILURES ===================================
______________________ test_get_failure_connection_failed ______________________
def test_get_failure_connection_failed():
request = make_request("")
request.side_effect = exceptions.TransportError()
with pytest.raises(exceptions.TransportError) as excinfo:
_metadata.get(request, PATH)
assert excinfo.match(r"Compute Engine Metadata server unavailable")
request.assert_called_with(
method="GET",
url=_metadata._METADATA_ROOT + PATH,
headers=_metadata._METADATA_HEADERS,
)
> assert request.call_count == 3
E AssertionError: assert 5 == 3
E + where 5 = <MagicMock spec='Request' id='140641503619536'>.call_count
tests/compute_engine/test__metadata.py:207: AssertionError
…mpute_engine._metadata.get() Initial fix of issue googleapis#211 was done in CL googleapis#323, but only for .ping() This one is adding same behaviour & tests for .get() method, as the problem still occurres See the issue for details Refs: googleapis#323 Resolves: googleapis#211
Updated call count in tests; ping me if I need to rebase to current master |
2f75de9
to
3a1187f
Compare
Initial fix of issue #211 was done in CL #323, but only for .ping()
This one is adding same behavior & tests for .get() method, as the problem still arises
Resolves: #211