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

cmd/test: caching test results takes 50 seconds #35801

Open
rillig opened this issue Nov 23, 2019 · 4 comments
Open

cmd/test: caching test results takes 50 seconds #35801

rillig opened this issue Nov 23, 2019 · 4 comments

Comments

@rillig
Copy link
Contributor

@rillig rillig commented Nov 23, 2019

What version of Go are you using (go version)?

go version go1.13.1 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\rillig\AppData\Local\go-build
set GOENV=C:\Users\rillig\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\rillig\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\rillig\Program Files\cygwin\tmp\go-build091584506=/tmp/go-build -gno-record-gcc-switches
go: failed to remove work dir: GetFileInformationByHandle C:\Users\rillig\Program Files\cygwin\tmp\go-build091584506\NUL: Unzulässige Funktion.

The last line of the above output looks interesting in itself.

What did you do?

cd "$GOPATH/src"
go get github.com/rillig/pkglint
mv github.com/rillig/pkglint to netbsd.org/pkglint
cd netbsd.org/pkglint

go generate ./... && time go test ./...
# takes 20 seconds to run the test
# then, takes 50 seconds to cache the test results
go generate ./... && time go test -test.count 1 ./...
# takes 20 seconds

What did you expect to see?

Caching the test results needs less than a second.

What did you see instead?

Caching the test results takes much longer than running the test.
It doesn't matter whether I run the tests from within cmd.exe or Cygwin.

rillig added a commit to rillig/pkglint that referenced this issue Nov 23, 2019
Before: 70 seconds, after: 20 seconds.

See golang/go#35801
@toothrot
Copy link
Contributor

@toothrot toothrot commented Nov 26, 2019

That go env failure sounds similar to #30789, which @bcmills, @bradfitz and @alexbrainman have some experience with. I'm wondering if it's related to the comment added in golang.org/cl/172337.

@toothrot toothrot added this to the Backlog milestone Nov 26, 2019
@bcmills
Copy link
Member

@bcmills bcmills commented Nov 26, 2019

Both of those seem like symptoms of an unusually slow filesystem.

@rillig, what kind of disk is your GOCACHE hosted on, and do you have any utilities (such as antivirus scanners) running for files on that disk?

@rillig
Copy link
Contributor Author

@rillig rillig commented Nov 26, 2019

@bcmills The GOCACHE is on an SSD, therefore I expect it to be pretty fast. The antivirus scanner sounds plausible, therefore I tried to reproduce it today, but it was reasonably fast. I'll try again tomorroy, to get another measuring.

@alexbrainman
Copy link
Member

@alexbrainman alexbrainman commented Nov 28, 2019

@rillig I don't have Cygwin. I tried guessing your repro, but failed

c:\Users\Alex\dev\go\src>cd %GOPATH%

c:\Users\Alex\dev>cd src

c:\Users\Alex\dev\src>go get github.com/rillig/pkglint
package netbsd.org/pkglint/getopt: unrecognized import path "netbsd.org/pkglint/getopt": reading https://netbsd.org/pkglint/getopt?go-get=1: 404 Not Found
package netbsd.org/pkglint/histogram: unrecognized import path "netbsd.org/pkglint/histogram": reading https://netbsd.org/pkglint/histogram?go-get=1: 404 Not Found
package netbsd.org/pkglint/licenses: unrecognized import path "netbsd.org/pkglint/licenses": reading https://netbsd.org/pkglint/licenses?go-get=1: 404 Not Found
package netbsd.org/pkglint/pkgver: unrecognized import path "netbsd.org/pkglint/pkgver": reading https://netbsd.org/pkglint/pkgver?go-get=1: 404 Not Found
package netbsd.org/pkglint/regex: unrecognized import path "netbsd.org/pkglint/regex": reading https://netbsd.org/pkglint/regex?go-get=1: 404 Not Found
package netbsd.org/pkglint/textproc: unrecognized import path "netbsd.org/pkglint/textproc": reading https://netbsd.org/pkglint/textproc?go-get=1: 404 Not Found
package netbsd.org/pkglint/trace: unrecognized import path "netbsd.org/pkglint/trace": reading https://netbsd.org/pkglint/trace?go-get=1: 404 Not Found

c:\Users\Alex\dev\src>

Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.