Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion test/end2end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3960,7 +3960,19 @@ func (s) TestServerStreaming_ClientCallSendMsgTwice(t *testing.T) {
// Block until the stream’s context is done. Second call to client.SendMsg
// triggers a RST_STREAM which cancels the stream context on the server.
<-stream.Context().Done()
if err := stream.SendMsg(&testpb.StreamingOutputCallRequest{}); status.Code(err) != codes.Canceled {
var err error
waitCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
defer cancel()
for ; waitCtx.Err() == nil; <-time.After(time.Millisecond) {
err = stream.SendMsg(&testpb.StreamingOutputCallRequest{})
if err != nil {
break
}
}
if waitCtx.Err() != nil {
t.Fatalf("Context timed out waiting for stream.SendMsg() to return an error")
}
if status.Code(err) != codes.Canceled {
t.Errorf("stream.SendMsg() = %v, want error %v", err, codes.Canceled)
}
close(handlerDone)
Expand Down
Loading