Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: flaky tests on macOS #33585

Closed
FiloSottile opened this issue Aug 11, 2019 · 4 comments
Closed

net/http: flaky tests on macOS #33585

FiloSottile opened this issue Aug 11, 2019 · 4 comments
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@FiloSottile
Copy link
Contributor

$ go version
go version devel +8b058cfbce Sun Aug 11 15:44:08 2019 +0000 darwin/amd64
go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/valsorda/Library/Caches/go-build"
GOENV="/Users/valsorda/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/valsorda"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org"
GOROOT="/Users/valsorda/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/valsorda/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/valsorda/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/df/mrk3bfz149n8zb5h5p1vp_1m00hbbm/T/go-build710921669=/tmp/go-build -gno-record-gcc-switches -fno-common"

Got a mix of these test failures running go test -count 100 net/http on macOS Mojave 10.14.5.

--- FAIL: TestTransportConcurrency (0.11s)
    transport_test.go:1802: error on req request-363: Get http://127.0.0.1:52910/?echo=request-363: read tcp 127.0.0.1:53104->127.0.0.1:52910: read: connection reset by peer
--- FAIL: TestTransportConcurrency (0.26s)
    transport_test.go:1802: error on req request-17: Get http://127.0.0.1:56414/?echo=request-17: read tcp 127.0.0.1:56415->127.0.0.1:56414: read: connection reset by peer
--- FAIL: TestTransportConcurrency (0.24s)
    transport_test.go:1802: error on req request-0: Get http://127.0.0.1:55567/?echo=request-0: write tcp 127.0.0.1:55570->127.0.0.1:55567: write: broken pipe
--- FAIL: TestServerEmptyBodyRace_h1 (0.01s)
    serve_test.go:4289: Get http://127.0.0.1:60346: read tcp 127.0.0.1:60347->127.0.0.1:60346: read: connection reset by peer
    serve_test.go:4302: handler ran 19 times; want 20
--- FAIL: TestTransportDiscardsUnneededConns (0.03s)
    clientserver_test.go:1003: Get: Get https://127.0.0.1:51848: write tcp 127.0.0.1:51854->127.0.0.1:51848: write: broken pipe
--- FAIL: TestTransportPersistConnLeak (0.01s)
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: read tcp 127.0.0.1:62976->127.0.0.1:62971: read: connection reset by peer
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: read tcp 127.0.0.1:62972->127.0.0.1:62971: read: connection reset by peer
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: read tcp 127.0.0.1:62979->127.0.0.1:62971: read: connection reset by peer
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: read tcp 127.0.0.1:62975->127.0.0.1:62971: read: connection reset by peer
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: read tcp 127.0.0.1:62974->127.0.0.1:62971: read: connection reset by peer
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: read tcp 127.0.0.1:62977->127.0.0.1:62971: read: connection reset by peer
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: write tcp 127.0.0.1:62988->127.0.0.1:62971: write: broken pipe
    transport_test.go:1579: client fetch error: Get http://127.0.0.1:62971: read tcp 127.0.0.1:62978->127.0.0.1:62971: read: connection reset by peer
panic: Fail in goroutine after TestTransportPersistConnLeak has completed

goroutine 6888 [running]:
testing.(*common).Fail(0xc0000ec400)
	/Users/valsorda/go/src/testing/testing.go:609 +0x151
testing.(*common).Errorf(0xc0000ec400, 0x1591950, 0x16, 0xc00028cf98, 0x1, 0x1)
	/Users/valsorda/go/src/testing/testing.go:704 +0x90
net/http_test.TestTransportPersistConnLeak.func2(0xc0006148a0, 0xc000232ae0, 0xc000640200, 0xc0000ec400, 0xc000640280)
	/Users/valsorda/go/src/net/http/transport_test.go:1579 +0xec
created by net/http_test.TestTransportPersistConnLeak
	/Users/valsorda/go/src/net/http/transport_test.go:1575 +0x256
panic: Fail in goroutine after TestTransportPersistConnLeak has completed

goroutine 6867 [running]:
testing.(*common).Fail(0xc0000ec400)
	/Users/valsorda/go/src/testing/testing.go:609 +0x151
testing.(*common).Errorf(0xc0000ec400, 0x1591950, 0x16, 0xc0002e7f98, 0x1, 0x1)
	/Users/valsorda/go/src/testing/testing.go:704 +0x90
net/http_test.TestTransportPersistConnLeak.func2(0xc0006148a0, 0xc000232ae0, 0xc000640200, 0xc0000ec400, 0xc000640280)
	/Users/valsorda/go/src/net/http/transport_test.go:1579 +0xec
created by net/http_test.TestTransportPersistConnLeak
	/Users/valsorda/go/src/net/http/transport_test.go:1575 +0x256
panic: Fail in goroutine after TestTransportPersistConnLeak has completed

goroutine 6880 [running]:
testing.(*common).Fail(0xc0000ec400)
	/Users/valsorda/go/src/testing/testing.go:609 +0x151
testing.(*common).Errorf(0xc0000ec400, 0x1591950, 0x16, 0xc00034af98, 0x1, 0x1)
	/Users/valsorda/go/src/testing/testing.go:704 +0x90
net/http_test.TestTransportPersistConnLeak.func2(0xc0006148a0, 0xc000232ae0, 0xc000640200, 0xc0000ec400, 0xc000640280)
	/Users/valsorda/go/src/net/http/transport_test.go:1579 +0xec
created by net/http_test.TestTransportPersistConnLeak
	/Users/valsorda/go/src/net/http/transport_test.go:1575 +0x256
exit status 2

Seems similar to #18541, which did not have a clear resolution.

/cc @bradfitz

@FiloSottile FiloSottile added Testing An issue that has been verified to require only test changes, not just a test failure. OS-Darwin NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 11, 2019
@FiloSottile FiloSottile added this to the Unplanned milestone Aug 11, 2019
@gopherbot
Copy link

Change https://golang.org/cl/261538 mentions this issue: net/http: deflake TestTransportPersistConnLeak on macOS

gopherbot pushed a commit that referenced this issue Oct 12, 2020
On a loaded system, sometimes connections don't work out.
Ignore those in TestTransportPersistConnLeak to avoid flakes.

For #33585.

Change-Id: Ic07057532dc0ea5115d6ec49c3c29099a9382295
Reviewed-on: https://go-review.googlesource.com/c/go/+/261538
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Russ Cox <rsc@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/261698 mentions this issue: net/http: deflake TestServerEmptyBodyRace_h1, or at least try

gopherbot pushed a commit that referenced this issue Oct 16, 2020
Fixes #22540.
For #33585.

Change-Id: I504b5a91ce1a39cd4ffd2380178a1b8f82f49dd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/261698
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/263144 mentions this issue: net/http: try to deflake TestTransportDiscardsUnneededConns

@golang golang locked and limited conversation to collaborators Oct 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants