Skip to content

Commit 62260a0

Browse files
neildromaindoumenc
authored andcommitted
net/http: fix some test flakes caused by test refactoring
Skip TestTransportPersistConnLeakShortBody in HTTP/2 mode; it's flaky and was previously HTTP/1-only. Don't run TestTransportEventTrace and TestTransportIgnores408 in parallel. Change-Id: I76bc540fac9317185ef7d414c9deafb35bc926b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/442495 Reviewed-by: Bryan Mills <[email protected]> Run-TryBot: Damien Neil <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent d2a561b commit 62260a0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/net/http/transport_test.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -1751,6 +1751,10 @@ func TestTransportPersistConnLeakShortBody(t *testing.T) {
17511751
run(t, testTransportPersistConnLeakShortBody, testNotParallel)
17521752
}
17531753
func testTransportPersistConnLeakShortBody(t *testing.T, mode testMode) {
1754+
if mode == http2Mode {
1755+
t.Skip("flaky in HTTP/2")
1756+
}
1757+
17541758
// Not parallel: measures goroutines.
17551759
ts := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
17561760
})).ts
@@ -4465,14 +4469,14 @@ func testTransportResponseHeaderLength(t *testing.T, mode testMode) {
44654469
func TestTransportEventTrace(t *testing.T) {
44664470
run(t, func(t *testing.T, mode testMode) {
44674471
testTransportEventTrace(t, mode, false)
4468-
})
4472+
}, testNotParallel)
44694473
}
44704474

44714475
// test a non-nil httptrace.ClientTrace but with all hooks set to zero.
44724476
func TestTransportEventTrace_NoHooks(t *testing.T) {
44734477
run(t, func(t *testing.T, mode testMode) {
44744478
testTransportEventTrace(t, mode, true)
4475-
})
4479+
}, testNotParallel)
44764480
}
44774481

44784482
func testTransportEventTrace(t *testing.T, mode testMode, noHooks bool) {
@@ -5970,7 +5974,9 @@ func TestIs408(t *testing.T) {
59705974
}
59715975
}
59725976

5973-
func TestTransportIgnores408(t *testing.T) { run(t, testTransportIgnores408, []testMode{http1Mode}) }
5977+
func TestTransportIgnores408(t *testing.T) {
5978+
run(t, testTransportIgnores408, []testMode{http1Mode}, testNotParallel)
5979+
}
59745980
func testTransportIgnores408(t *testing.T, mode testMode) {
59755981
// Not parallel. Relies on mutating the log package's global Output.
59765982
defer log.SetOutput(log.Writer())

0 commit comments

Comments
 (0)