(t *testing.T, port int, sc *ServerConfig, ht hType, copts ConnectOptions)
| 595 | } |
| 596 | |
| 597 | func setUpWithOptions(t *testing.T, port int, sc *ServerConfig, ht hType, copts ConnectOptions) (*server, *http2Client, func()) { |
| 598 | server := setUpServerOnly(t, port, sc, ht) |
| 599 | addr := resolver.Address{Addr: "localhost:" + server.port} |
| 600 | copts.ChannelzParent = channelzSubChannel(t) |
| 601 | |
| 602 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 603 | t.Cleanup(cancel) |
| 604 | connectCtx, cCancel := context.WithTimeout(context.Background(), 2*time.Second) |
| 605 | ct, connErr := NewHTTP2Client(connectCtx, ctx, addr, copts, func(GoAwayInfo) {}) |
| 606 | if connErr != nil { |
| 607 | cCancel() // Do not cancel in success path. |
| 608 | t.Fatalf("failed to create transport: %v", connErr) |
| 609 | } |
| 610 | return server, ct.(*http2Client), cCancel |
| 611 | } |
| 612 | |
| 613 | type controllablePingServer struct { |
| 614 | pingAck atomic.Bool |
no test coverage detected