Call object's `.cancelled()` is not guaranteed to immediately return
True per spec even if `cancel()` is called. `.code()` ensures that
the RPC is terminated before we check for `.cancelled()` to ensure
our test is not stricter than necessary (a conforming implementation
should be allowed to return `False` on `cancelled()` for a bit due
to a race or something. This change makes the test more generically
applicable to other implementations.
* Support echo status and metadata for interop test server
* Add set_code and set_details for ServicerContext
* Add an is_ok() method on cygrpc._AioCall object
* Sanitize user supplied status code
* Prettify server-side unexpected exception log
* Reduce log spams from unary calls
Separated the tests for testing how a channel is closed into another
test file.
Fixed a bug introduced into the interceptors code in the previous
commit.
When the channel is closed, either by calling explicitly the `close()`
method or by leaving an asyncrhonous channel context all ongoing RPCs will be
cancelled.
Now the status and the initial metadata, as awaitable methods, are
provided by the Cython layer. Any time the Python layer, like the Call
object, needs to know the status of the initial metadata uses the new
methods published by the AioCall