(c *rpcConfig)
| 396 | } |
| 397 | |
| 398 | func (te *test) doServerStreamCall(c *rpcConfig) (proto.Message, []proto.Message, error) { |
| 399 | var ( |
| 400 | req *testpb.StreamingOutputCallRequest |
| 401 | resps []proto.Message |
| 402 | err error |
| 403 | ) |
| 404 | |
| 405 | tc := testgrpc.NewTestServiceClient(te.ss.CC) |
| 406 | ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) |
| 407 | defer cancel() |
| 408 | ctx = metadata.NewOutgoingContext(ctx, testMetadata) |
| 409 | |
| 410 | var startID int32 |
| 411 | if !c.success { |
| 412 | startID = errorID |
| 413 | } |
| 414 | req = &testpb.StreamingOutputCallRequest{Payload: idToPayload(startID)} |
| 415 | stream, err := tc.StreamingOutputCall(ctx, req) |
| 416 | if err != nil { |
| 417 | return req, resps, err |
| 418 | } |
| 419 | for { |
| 420 | var resp *testpb.StreamingOutputCallResponse |
| 421 | resp, err := stream.Recv() |
| 422 | if err == io.EOF { |
| 423 | return req, resps, nil |
| 424 | } else if err != nil { |
| 425 | return req, resps, err |
| 426 | } |
| 427 | resps = append(resps, resp) |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | type expectedData struct { |
| 432 | te *test |
no test coverage detected