Skip to content

Commit 16be34d

Browse files
neildgopherbot
authored andcommitted
net/http: add more tests of transport connection pool
Add a variety of addtional tests exercising client connection pooling, in particular HTTP/2 connection behavior. Change-Id: I7609d36db5865f1b95c903cfadb0c3233e046c09 Reviewed-on: https://go-review.googlesource.com/c/go/+/615896 Reviewed-by: Nicholas Husin <[email protected]> Reviewed-by: Nicholas Husin <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Damien Neil <[email protected]>
1 parent 3e4540b commit 16be34d

File tree

3 files changed

+448
-91
lines changed

3 files changed

+448
-91
lines changed

src/net/http/clientserver_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ func newClientServerTest(t testing.TB, mode testMode, h Handler, opts ...any) *c
207207
transportFuncs = append(transportFuncs, opt)
208208
case func(*httptest.Server):
209209
opt(cst.ts)
210+
case func(*Server):
211+
opt(cst.ts.Config)
210212
default:
211213
t.Fatalf("unhandled option type %T", opt)
212214
}

src/net/http/http2_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2025 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build !nethttpomithttp2
6+
7+
package http
8+
9+
func init() {
10+
// Disable HTTP/2 internal channel pooling which interferes with synctest.
11+
http2inTests = true
12+
}

0 commit comments

Comments
 (0)