net/http: re-enable HTTP/3 tests

Also enable some additional tests that were previously skipped due to
being flaky but are now okay.

For #78737
For #70914

Change-Id: I76747d45673d9cdae7c1b7a5aff64b0a6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/768082
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
Nicholas S. Husin 2026-04-16 16:03:45 -04:00 committed by Nicholas Husin
parent 85f838f46c
commit efa1eecc7d
3 changed files with 4 additions and 23 deletions

View file

@ -1302,11 +1302,7 @@ func testClientTimeout(t *testing.T, mode testMode) {
}
// Client.Timeout firing before getting to the body
func TestClientTimeout_Headers(t *testing.T) {
// Running this test against our HTTP/3 implementation with race detector
// trips off TestMain's goroutine leak detection.
run(t, testClientTimeout_Headers, http3SkippedMode)
}
func TestClientTimeout_Headers(t *testing.T) { run(t, testClientTimeout_Headers) }
func testClientTimeout_Headers(t *testing.T, mode testMode) {
donec := make(chan bool, 1)
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
@ -2226,10 +2222,7 @@ func TestClientPopulatesNilResponseBody(t *testing.T) {
}
// Issue 40382: Client calls Close multiple times on Request.Body.
func TestClientCallsCloseOnlyOnce(t *testing.T) {
// Trips off race detector for HTTP/3.
run(t, testClientCallsCloseOnlyOnce, http3SkippedMode)
}
func TestClientCallsCloseOnlyOnce(t *testing.T) { run(t, testClientCallsCloseOnlyOnce) }
func testClientCallsCloseOnlyOnce(t *testing.T, mode testMode) {
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
w.WriteHeader(StatusNoContent)

View file

@ -115,12 +115,6 @@ func run[T TBRun[T]](t T, f func(t T, mode testMode), opts ...any) {
setParallel(t)
}
for _, mode := range modes {
// HTTP/3 tests are unfortunately still flakier than we would like.
// Disable them for now.
// TODO(nsh): re-enable the tests once they are no longer flaky.
if mode == http3Mode {
continue
}
t.Run(string(mode), func(t T) {
t.Helper()
if t, ok := any(t).(*testing.T); ok && parallel {

View file

@ -965,10 +965,7 @@ func testServerWriteTimeout(t *testing.T, mode testMode) {
}
}
func TestServerNoWriteTimeout(t *testing.T) {
// Trips off race detector for HTTP/3.
run(t, testServerNoWriteTimeout, http3SkippedMode)
}
func TestServerNoWriteTimeout(t *testing.T) { run(t, testServerNoWriteTimeout) }
func testServerNoWriteTimeout(t *testing.T, mode testMode) {
for _, timeout := range []time.Duration{0, -1} {
cst := newClientServerTest(t, mode, HandlerFunc(func(res ResponseWriter, req *Request) {
@ -3365,10 +3362,7 @@ func (r *bodyLimitReader) Close() error {
return nil
}
func TestRequestBodyLimit(t *testing.T) {
// Trips off race detector for HTTP/3.
run(t, testRequestBodyLimit, http3SkippedMode)
}
func TestRequestBodyLimit(t *testing.T) { run(t, testRequestBodyLimit) }
func testRequestBodyLimit(t *testing.T, mode testMode) {
const limit = 1 << 20
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {