chore: test that ServiceUnavailable is retried#970
Conversation
| # validate test assumptions | ||
| assert client_under_test._transport is mock_transport | ||
|
|
||
| mock_transport.create_read_session.side_effect = [ |
There was a problem hiding this comment.
QUESTION:
When we assign a list to the attribute class.method.side_effect (i.e. mock_transport.create_read_session.side_effect), every time the method gets called, the next item in the list will be produced as the result of the method call.
We have three items in the list.
One line 135 we confirm that the create_read_session method has been called thrice.
But I do not see where we make those three calls.
I see one call on line 127.
What am I missing?
Besides this question, everything else LGTM and will approve on that basis.
There was a problem hiding this comment.
But I do not see where we make those three calls.
There are several layers in the client library. To write this test, I had to figure out how to mock out the level that gets wrapped by the retry logic, which is about as low of a layer we can get in Python before it switches over to gRPC C++ stuff. The retry method is implemented as a wrapper on top of this method. So the 3 calls are my way of verifying that the first two get retried.
I wrote this test while investigating #969. Turns out that the default retry is working fine, but for some reason BigFrames is turning it off.
Even though it didn't uncover any bugs here, I think it could be useful still to have this test here.
Fixes #969 🦕