(t *testing.T)
| 1514 | } |
| 1515 | |
| 1516 | func (s) TestGRPCLBStatsStreamingSuccess(t *testing.T) { |
| 1517 | if err := runAndCheckStats(t, false, nil, func(cc *grpc.ClientConn) { |
| 1518 | testC := testgrpc.NewTestServiceClient(cc) |
| 1519 | ctx, cancel := context.WithTimeout(context.Background(), defaultFallbackTimeout) |
| 1520 | defer cancel() |
| 1521 | // The first non-failfast RPC succeeds, all connections are up. |
| 1522 | stream, err := testC.FullDuplexCall(ctx, grpc.WaitForReady(true)) |
| 1523 | if err != nil { |
| 1524 | t.Fatalf("%v.FullDuplexCall(_, _) = _, %v, want _, <nil>", testC, err) |
| 1525 | } |
| 1526 | for { |
| 1527 | if _, err = stream.Recv(); err == io.EOF { |
| 1528 | break |
| 1529 | } |
| 1530 | } |
| 1531 | for i := 0; i < countRPC-1; i++ { |
| 1532 | stream, err = testC.FullDuplexCall(ctx) |
| 1533 | if err == nil { |
| 1534 | // Wait for stream to end if err is nil. |
| 1535 | for { |
| 1536 | if _, err = stream.Recv(); err == io.EOF { |
| 1537 | break |
| 1538 | } |
| 1539 | } |
| 1540 | } |
| 1541 | } |
| 1542 | }, &rpcStats{ |
| 1543 | numCallsStarted: int64(countRPC), |
| 1544 | numCallsFinished: int64(countRPC), |
| 1545 | numCallsFinishedKnownReceived: int64(countRPC), |
| 1546 | }); err != nil { |
| 1547 | t.Fatal(err) |
| 1548 | } |
| 1549 | } |
| 1550 | |
| 1551 | func (s) TestGRPCLBStatsStreamingDrop(t *testing.T) { |
| 1552 | if err := runAndCheckStats(t, true, nil, func(cc *grpc.ClientConn) { |
nothing calls this directly
no test coverage detected