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/go: doc mentions "cacheable flag" but never lists them #42544

Closed
yansal opened this issue Nov 12, 2020 · 2 comments
Closed

cmd/go: doc mentions "cacheable flag" but never lists them #42544

yansal opened this issue Nov 12, 2020 · 2 comments

Comments

@yansal
Copy link
Contributor

yansal commented Nov 12, 2020

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

$ go version
go version go1.15.4 linux/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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/yann/.cache/go-build"
GOENV="/home/yann/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/yann/go/pkg/mod"
GONOPROXY="github.com/ulule/*"
GONOSUMDB="github.com/ulule/*"
GOOS="linux"
GOPATH="/home/yann/go"
GOPRIVATE="github.com/ulule/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/yann/sdk/go1.15.4"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/yann/sdk/go1.15.4/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/yann/ulule/api/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build121862110=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run go test path/to/my/pkgs/... -failfast

What did you expect to see?

Test results to be cached.

What did you see instead?

Tests results are not cached when the -failfast is present.

The doc at https://golang.org/cmd/go/#hdr-Testing_flags says:

When 'go test' runs in package list mode, 'go test' caches successful package test results to avoid unnecessary repeated running of tests. To disable test caching, use any test flag or argument other than the cacheable flags. The idiomatic way to disable test caching explicitly is to use -count=1.

But there is no definition of "cacheable flags".

@ALTree
Copy link
Member

ALTree commented Nov 12, 2020

It's in go help test:

$ go help test | grep -C2 cacheable

The rule for a match in the cache is that the run involves the same
test binary and the flags on the command line come entirely from a
restricted set of 'cacheable' test flags, defined as -cpu, -list,
-parallel, -run, -short, and -v.

and also in the page you linked, search "cacheable" in the page.

@yansal
Copy link
Contributor Author

yansal commented Nov 12, 2020

I missed that, thank you, and sorry for the noise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants