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