(t *testing.T, e env)
| 966 | } |
| 967 | |
| 968 | func testTimeoutOnDeadServer(t *testing.T, e env) { |
| 969 | te := newTest(t, e) |
| 970 | te.userAgent = testAppUA |
| 971 | te.startServer(&testServer{security: e.security}) |
| 972 | defer te.tearDown() |
| 973 | |
| 974 | cc := te.clientConn() |
| 975 | tc := testgrpc.NewTestServiceClient(cc) |
| 976 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 977 | defer cancel() |
| 978 | if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); err != nil { |
| 979 | t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err) |
| 980 | } |
| 981 | // Wait for the client to report READY, stop the server, then wait for the |
| 982 | // client to notice the connection is gone. |
| 983 | testutils.AwaitState(ctx, t, cc, connectivity.Ready) |
| 984 | te.srv.Stop() |
| 985 | testutils.AwaitNotState(ctx, t, cc, connectivity.Ready) |
| 986 | ctx, cancel = context.WithTimeout(ctx, defaultTestShortTimeout) |
| 987 | defer cancel() |
| 988 | if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); status.Code(err) != codes.DeadlineExceeded { |
| 989 | t.Fatalf("TestService/EmptyCall(%v, _) = _, %v, want _, error code: %s", ctx, err, codes.DeadlineExceeded) |
| 990 | } |
| 991 | awaitNewConnLogOutput() |
| 992 | } |
| 993 | |
| 994 | func (s) TestServerGracefulStopIdempotent(t *testing.T) { |
| 995 | for _, e := range listTestEnv() { |
no test coverage detected