(c *rpcConfig)
| 361 | } |
| 362 | |
| 363 | func (te *test) doClientStreamCall(c *rpcConfig) ([]proto.Message, *testpb.StreamingInputCallResponse, error) { |
| 364 | var ( |
| 365 | reqs []proto.Message |
| 366 | resp *testpb.StreamingInputCallResponse |
| 367 | err error |
| 368 | ) |
| 369 | tCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 370 | defer cancel() |
| 371 | tc := testgrpc.NewTestServiceClient(te.clientConn(tCtx)) |
| 372 | stream, err := tc.StreamingInputCall(metadata.NewOutgoingContext(tCtx, testMetadata), grpc.WaitForReady(!c.failfast)) |
| 373 | if err != nil { |
| 374 | return reqs, resp, err |
| 375 | } |
| 376 | var startID int32 |
| 377 | if !c.success { |
| 378 | startID = errorID |
| 379 | } |
| 380 | for i := 0; i < c.count; i++ { |
| 381 | req := &testpb.StreamingInputCallRequest{ |
| 382 | Payload: idToPayload(int32(i) + startID), |
| 383 | } |
| 384 | reqs = append(reqs, req) |
| 385 | if err = stream.Send(req); err != nil { |
| 386 | return reqs, resp, err |
| 387 | } |
| 388 | } |
| 389 | resp, err = stream.CloseAndRecv() |
| 390 | return reqs, resp, err |
| 391 | } |
| 392 | |
| 393 | func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.StreamingOutputCallRequest, []proto.Message, error) { |
| 394 | var ( |
no test coverage detected