@@ -336,6 +336,9 @@ func (s *server) start(t *testing.T, port int, serverConfig *ServerConfig, ht hT
336336 if err != nil {
337337 return
338338 }
339+ if serverConfig .MaxStreams == 0 {
340+ serverConfig .MaxStreams = math .MaxUint32
341+ }
339342 transport , err := NewServerTransport (conn , serverConfig )
340343 if err != nil {
341344 return
@@ -442,8 +445,8 @@ func setUpServerOnly(t *testing.T, port int, sc *ServerConfig, ht hType) *server
442445 return server
443446}
444447
445- func setUp (t * testing.T , port int , maxStreams uint32 , ht hType ) (* server , * http2Client , func ()) {
446- return setUpWithOptions (t , port , & ServerConfig {MaxStreams : maxStreams }, ht , ConnectOptions {})
448+ func setUp (t * testing.T , port int , ht hType ) (* server , * http2Client , func ()) {
449+ return setUpWithOptions (t , port , & ServerConfig {}, ht , ConnectOptions {})
447450}
448451
449452func setUpWithOptions (t * testing.T , port int , sc * ServerConfig , ht hType , copts ConnectOptions ) (* server , * http2Client , func ()) {
@@ -538,7 +541,7 @@ func (s) TestInflightStreamClosing(t *testing.T) {
538541
539542// Tests that when streamID > MaxStreamId, the current client transport drains.
540543func (s ) TestClientTransportDrainsAfterStreamIDExhausted (t * testing.T ) {
541- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , normal )
544+ server , ct , cancel := setUp (t , 0 , normal )
542545 defer cancel ()
543546 defer server .stop ()
544547 callHdr := & CallHdr {
@@ -583,7 +586,7 @@ func (s) TestClientTransportDrainsAfterStreamIDExhausted(t *testing.T) {
583586}
584587
585588func (s ) TestClientSendAndReceive (t * testing.T ) {
586- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , normal )
589+ server , ct , cancel := setUp (t , 0 , normal )
587590 defer cancel ()
588591 callHdr := & CallHdr {
589592 Host : "localhost" ,
@@ -623,7 +626,7 @@ func (s) TestClientSendAndReceive(t *testing.T) {
623626}
624627
625628func (s ) TestClientErrorNotify (t * testing.T ) {
626- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , normal )
629+ server , ct , cancel := setUp (t , 0 , normal )
627630 defer cancel ()
628631 go server .stop ()
629632 // ct.reader should detect the error and activate ct.Error().
@@ -657,7 +660,7 @@ func performOneRPC(ct ClientTransport) {
657660}
658661
659662func (s ) TestClientMix (t * testing.T ) {
660- s , ct , cancel := setUp (t , 0 , math . MaxUint32 , normal )
663+ s , ct , cancel := setUp (t , 0 , normal )
661664 defer cancel ()
662665 time .AfterFunc (time .Second , s .stop )
663666 go func (ct ClientTransport ) {
@@ -671,7 +674,7 @@ func (s) TestClientMix(t *testing.T) {
671674}
672675
673676func (s ) TestLargeMessage (t * testing.T ) {
674- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , normal )
677+ server , ct , cancel := setUp (t , 0 , normal )
675678 defer cancel ()
676679 callHdr := & CallHdr {
677680 Host : "localhost" ,
@@ -806,7 +809,7 @@ func (s) TestLargeMessageWithDelayRead(t *testing.T) {
806809// proceed until they complete naturally, while not allowing creation of new
807810// streams during this window.
808811func (s ) TestGracefulClose (t * testing.T ) {
809- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , pingpong )
812+ server , ct , cancel := setUp (t , 0 , pingpong )
810813 defer cancel ()
811814 defer func () {
812815 // Stop the server's listener to make the server's goroutines terminate
@@ -872,7 +875,7 @@ func (s) TestGracefulClose(t *testing.T) {
872875}
873876
874877func (s ) TestLargeMessageSuspension (t * testing.T ) {
875- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , suspended )
878+ server , ct , cancel := setUp (t , 0 , suspended )
876879 defer cancel ()
877880 callHdr := & CallHdr {
878881 Host : "localhost" ,
@@ -980,7 +983,7 @@ func (s) TestMaxStreams(t *testing.T) {
980983}
981984
982985func (s ) TestServerContextCanceledOnClosedConnection (t * testing.T ) {
983- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , suspended )
986+ server , ct , cancel := setUp (t , 0 , suspended )
984987 defer cancel ()
985988 callHdr := & CallHdr {
986989 Host : "localhost" ,
@@ -1452,7 +1455,7 @@ func (s) TestClientWithMisbehavedServer(t *testing.T) {
14521455var encodingTestStatus = status .New (codes .Internal , "\n " )
14531456
14541457func (s ) TestEncodingRequiredStatus (t * testing.T ) {
1455- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , encodingRequiredStatus )
1458+ server , ct , cancel := setUp (t , 0 , encodingRequiredStatus )
14561459 defer cancel ()
14571460 callHdr := & CallHdr {
14581461 Host : "localhost" ,
@@ -1480,7 +1483,7 @@ func (s) TestEncodingRequiredStatus(t *testing.T) {
14801483}
14811484
14821485func (s ) TestInvalidHeaderField (t * testing.T ) {
1483- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , invalidHeaderField )
1486+ server , ct , cancel := setUp (t , 0 , invalidHeaderField )
14841487 defer cancel ()
14851488 callHdr := & CallHdr {
14861489 Host : "localhost" ,
@@ -1502,7 +1505,7 @@ func (s) TestInvalidHeaderField(t *testing.T) {
15021505}
15031506
15041507func (s ) TestHeaderChanClosedAfterReceivingAnInvalidHeader (t * testing.T ) {
1505- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , invalidHeaderField )
1508+ server , ct , cancel := setUp (t , 0 , invalidHeaderField )
15061509 defer cancel ()
15071510 defer server .stop ()
15081511 defer ct .Close (fmt .Errorf ("closed manually by test" ))
@@ -2170,7 +2173,7 @@ func (s) TestPingPong1MB(t *testing.T) {
21702173
21712174// This is a stress-test of flow control logic.
21722175func runPingPongTest (t * testing.T , msgSize int ) {
2173- server , client , cancel := setUp (t , 0 , 0 , pingpong )
2176+ server , client , cancel := setUp (t , 0 , pingpong )
21742177 defer cancel ()
21752178 defer server .stop ()
21762179 defer client .Close (fmt .Errorf ("closed manually by test" ))
@@ -2252,7 +2255,7 @@ func (s) TestHeaderTblSize(t *testing.T) {
22522255 }
22532256 }()
22542257
2255- server , ct , cancel := setUp (t , 0 , math . MaxUint32 , normal )
2258+ server , ct , cancel := setUp (t , 0 , normal )
22562259 defer cancel ()
22572260 defer ct .Close (fmt .Errorf ("closed manually by test" ))
22582261 defer server .stop ()
@@ -2611,7 +2614,7 @@ func TestConnectionError_Unwrap(t *testing.T) {
26112614
26122615func (s ) TestPeerSetInServerContext (t * testing.T ) {
26132616 // create client and server transports.
2614- server , client , cancel := setUp (t , 0 , math . MaxUint32 , normal )
2617+ server , client , cancel := setUp (t , 0 , normal )
26152618 defer cancel ()
26162619 defer server .stop ()
26172620 defer client .Close (fmt .Errorf ("closed manually by test" ))
0 commit comments