Create tests for two potential cardinality violation bugs #7570
Labels
Area: Testing
Includes tests and testing utilities that we have for unit and e2e tests within our repo.
Status: Help Wanted
Type: Testing
When looking into the generic stream interface documentation, I noticed a couple potential bugs in our code through inspection:
Test case: Using stubserver, create a client-streaming RPC handler (will need to be added similar to the unary/bidi streaming handlers) that just does
return nil
without first callingSendAndClose
. This should result in the client receiving an error when making this call and callingCloseAndRecv
. Also in this case, we should receiveError
log messages indicating what happened and that it is illegal behavior. Client streaming RPCs must terminate with either no message and a non-OK status, or a message and an OK status.We can also test the reverse case where it calls
SendAndClose
and returns an error from the handler that results in an RPC status. This is not necessarily "wrong" sinceSendAndClose
itself could return an error, but the behavior of the RPC should be that the RPC is terminated whenSendAndClose
is called, so the return value of the handler should be ignored.SendAndClose
is called, the server should perform a RST_STREAM() after sending the response message successfully. We should confirm this is happening.Test case: Using stubserver, create a client-streaming RPC handler (like above) that calls
SendAndClose
and then callsRecv
. Those operations should fail with an error indicating the stream was already closed. On the client side, just send messages continuously. An error should eventually propagate to the client'sSend
calls.Implementation plan:
Check if similar tests exist first. Then create these tests if not. If they fail, let's
t.Skip
them and check them in, and then file issues and fix the bugs and re-enable the tests.The text was updated successfully, but these errors were encountered: