Skip to content

net/http: TestRequestLimit/h2 becomes significantly more expensive and slower after x/[email protected] #66668

@dmitshur

Description

@dmitshur
#!watchflakes
post <-  pkg == "net/http" && test ~ `TestRequestLimit` && status == "ABORT"

I've initially observed this on various builders, most often linux-386 ones, but it seems to reproduce on darwin/arm64 too.

At tip without x/[email protected] (e.g., commit 61a3ee5), TestRequestLimit/h2 consistently passes in under a second:

$ go test -count=1 net/http -v -run=^TestRequestLimit$
=== RUN   TestRequestLimit
=== RUN   TestRequestLimit/h1
=== RUN   TestRequestLimit/h2
--- PASS: TestRequestLimit (0.14s)
    --- PASS: TestRequestLimit/h1 (0.06s)
    --- PASS: TestRequestLimit/h2 (0.08s)
PASS
ok  	net/http	0.491s
$ go test -count=1 net/http -run=^TestRequestLimit$
ok  	net/http	0.442s
$ go test -count=1 net/http -run=^TestRequestLimit$
ok  	net/http	0.395s
$ go test -count=1 net/http -run=^TestRequestLimit$
ok  	net/http	0.425s

When x/[email protected] is pulled in (e.g., CL 576295), it takes anywhere between 15 seconds and 200+ seconds:

$ go test -count=1 net/http -v -run=^TestRequestLimit$
=== RUN   TestRequestLimit
=== RUN   TestRequestLimit/h1
=== RUN   TestRequestLimit/h2
--- PASS: TestRequestLimit (14.94s)
    --- PASS: TestRequestLimit/h1 (0.06s)
    --- PASS: TestRequestLimit/h2 (14.88s)
PASS
ok  	net/http	15.327s
$ go test -count=1 net/http -v -run=^TestRequestLimit$
=== RUN   TestRequestLimit
=== RUN   TestRequestLimit/h1
=== RUN   TestRequestLimit/h2
--- PASS: TestRequestLimit (266.59s)
    --- PASS: TestRequestLimit/h1 (0.06s)
    --- PASS: TestRequestLimit/h2 (266.52s)
PASS
ok  	net/http	266.886s
$ go test -count=1 net/http -v -run=^TestRequestLimit$
=== RUN   TestRequestLimit
=== RUN   TestRequestLimit/h1
=== RUN   TestRequestLimit/h2
--- PASS: TestRequestLimit (205.00s)
    --- PASS: TestRequestLimit/h1 (0.05s)
    --- PASS: TestRequestLimit/h2 (204.95s)
PASS
ok  	net/http	205.313s

I'm seeing around 125% CPU usage while this one test runs. This seems to cause it to exceed the 180 second timeout on some builders, especially when running all other tests and not just this one.

CC @neild.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions