(t *testing.T, e env)
| 176 | } |
| 177 | |
| 178 | func testClientConnCloseAfterGoAwayWithActiveStream(t *testing.T, e env) { |
| 179 | te := newTest(t, e) |
| 180 | te.startServer(&testServer{security: e.security}) |
| 181 | defer te.tearDown() |
| 182 | cc := te.clientConn() |
| 183 | tc := testgrpc.NewTestServiceClient(cc) |
| 184 | |
| 185 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 186 | defer cancel() |
| 187 | if _, err := tc.FullDuplexCall(ctx); err != nil { |
| 188 | t.Fatalf("%v.FullDuplexCall(_) = _, %v, want _, <nil>", tc, err) |
| 189 | } |
| 190 | done := make(chan struct{}) |
| 191 | go func() { |
| 192 | te.srv.GracefulStop() |
| 193 | close(done) |
| 194 | }() |
| 195 | time.Sleep(50 * time.Millisecond) |
| 196 | cc.Close() |
| 197 | timeout := time.NewTimer(time.Second) |
| 198 | select { |
| 199 | case <-done: |
| 200 | case <-timeout.C: |
| 201 | t.Fatalf("Test timed-out.") |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | func (s) TestServerGoAway(t *testing.T) { |
| 206 | for _, e := range listTestEnv() { |
no test coverage detected