(ct ClientTransport)
| 827 | } |
| 828 | |
| 829 | func performOneRPC(ct ClientTransport) { |
| 830 | callHdr := &CallHdr{ |
| 831 | Host: "localhost", |
| 832 | Method: "foo.Small", |
| 833 | } |
| 834 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 835 | defer cancel() |
| 836 | s, err := ct.NewStream(ctx, callHdr, nil) |
| 837 | if err != nil { |
| 838 | return |
| 839 | } |
| 840 | opts := WriteOptions{Last: true} |
| 841 | if err := s.Write([]byte{}, newBufferSlice(expectedRequest), &opts); err == nil || err == io.EOF { |
| 842 | time.Sleep(5 * time.Millisecond) |
| 843 | // The following s.Recv()'s could error out because the |
| 844 | // underlying transport is gone. |
| 845 | // |
| 846 | // Read response |
| 847 | p := make([]byte, len(expectedResponse)) |
| 848 | s.readTo(p) |
| 849 | // Read io.EOF |
| 850 | s.readTo(p) |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | func (s) TestClientMix(t *testing.T) { |
| 855 | s, ct, cancel := setUp(t, 0, normal) |
no test coverage detected