Some new test cases in the latest suite revealed errors in how cancelation of unary RPCs was implemented in the conformance client, but it only impacted the "suspend" style of invocation (callback and blocking styles worked fine).
The issue is that the coroutineScope function doesn't return until all child coroutines complete. So even though the helper was using launch to create a concurrent coroutine, the whole thing blocked until that job finished. In order to fix that, I had to move the coroutineScope call higher up the call stack (out of a helper method on the UnaryClient adapter and into the conformance Client itself), so it also made sense to move the related InvokeStyle enum.
Most of the diff is inlining that helper into the conformance client. But I also had to add an exception handler to the async job, to actually complete the future (with an exception) if the coroutine gets canceled (which is the only way we expose canceling a suspend unary RPC).
Some new test cases in the latest suite revealed errors in how cancelation of unary RPCs was implemented in the conformance client, but it only impacted the "suspend" style of invocation (callback and blocking styles worked fine).
The issue is that the
coroutineScope
function doesn't return until all child coroutines complete. So even though the helper was usinglaunch
to create a concurrent coroutine, the whole thing blocked until that job finished. In order to fix that, I had to move thecoroutineScope
call higher up the call stack (out of a helper method on theUnaryClient
adapter and into the conformanceClient
itself), so it also made sense to move the relatedInvokeStyle
enum.Most of the diff is inlining that helper into the conformance client. But I also had to add an exception handler to the async job, to actually complete the future (with an exception) if the coroutine gets canceled (which is the only way we expose canceling a suspend unary RPC).