(t *testing.T, e env)
| 4235 | } |
| 4236 | |
| 4237 | func testExceedMaxStreamsLimit(t *testing.T, e env) { |
| 4238 | te := newTest(t, e) |
| 4239 | te.declareLogNoise( |
| 4240 | "http2Client.notifyError got notified that the client transport was broken", |
| 4241 | "Conn.resetTransport failed to create client transport", |
| 4242 | "grpc: the connection is closing", |
| 4243 | ) |
| 4244 | te.maxStream = 1 // Only allows 1 live stream per server transport. |
| 4245 | te.startServer(&testServer{security: e.security}) |
| 4246 | defer te.tearDown() |
| 4247 | |
| 4248 | cc := te.clientConn() |
| 4249 | tc := testgrpc.NewTestServiceClient(cc) |
| 4250 | |
| 4251 | _, err := tc.StreamingInputCall(te.ctx) |
| 4252 | if err != nil { |
| 4253 | t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, <nil>", tc, err) |
| 4254 | } |
| 4255 | // Loop until receiving the new max stream setting from the server. |
| 4256 | for { |
| 4257 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestShortTimeout) |
| 4258 | defer cancel() |
| 4259 | _, err := tc.StreamingInputCall(ctx) |
| 4260 | if err == nil { |
| 4261 | time.Sleep(50 * time.Millisecond) |
| 4262 | continue |
| 4263 | } |
| 4264 | if status.Code(err) == codes.DeadlineExceeded { |
| 4265 | break |
| 4266 | } |
| 4267 | t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, %s", tc, err, codes.DeadlineExceeded) |
| 4268 | } |
| 4269 | } |
| 4270 | |
| 4271 | func (s) TestStreamsQuotaRecovery(t *testing.T) { |
| 4272 | for _, e := range listTestEnv() { |
no test coverage detected