Uh oh!
There was an error while loading. Please reload this page.
fix: add retry to google.auth.compute_engine._metadata.get() - #398
Conversation
e0c2dbd to
917df1aCompareDaniilAnichin
commented
Dec 5, 2019
dhermes
commented
Dec 5, 2019
cc @busunkim96 @DaniilAnichin I am no longer maintaining this library. Cheers |
917df1a to
1226931Compare1226931 to
2f75de9Comparelucasmbrown
commented
Jan 8, 2020
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! |
busunkim96
commented
Jan 8, 2020
@lucasmbrown Thank you for the ping! I missed this PR. I'll take a look now. |
busunkim96
left a comment
There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.
…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#323Resolves: googleapis#211
DaniilAnichin
commented
Jan 9, 2020
Updated call count in tests; ping me if I need to rebase to current master |
2f75de9 to
3a1187fCompare
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