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: go test -cover interacts badly with cache #22652

Closed
rsc opened this issue Nov 10, 2017 · 1 comment
Closed

cmd/go: go test -cover interacts badly with cache #22652

rsc opened this issue Nov 10, 2017 · 1 comment
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Nov 10, 2017

$ go clean -cache
$ go test -cover math strings
ok  	math	0.014s	coverage: 84.2% of statements
ok  	strings	0.311s	coverage: 98.3% of statements
$ go clean -cache
$ go test -cover math
ok  	math	0.014s	coverage: 84.2% of statements
$ go test -cover math strings
ok  	math	(cached)	coverage: 84.2% of statements
ok  	strings	0.285s	coverage: 98.3% of statements
$ go clean -cache
$ go test -cover strings
ok  	strings	0.288s	coverage: 98.3% of statements
$ go test -cover math strings
# strings (testmain)
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:359:42: undefined: strings.GoCover_45
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:361:42: undefined: strings.GoCover_46
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:363:41: undefined: strings.GoCover_47
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:365:42: undefined: strings.GoCover_48
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:367:41: undefined: strings.GoCover_49
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:369:42: undefined: strings.GoCover_50
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:371:48: undefined: strings.GoCover_51
/var/folders/qk/vp4mp_hj5qlb_1_w97rgqc4r000n9d/T/go-build211189621/b047/_testmain.go:373:47: undefined: strings.GoCover_52
ok  	math	0.014s	coverage: 84.2% of statements
FAIL	strings [build failed]
$ ```
@rsc rsc added this to the Go1.10 milestone Nov 10, 2017
@gopherbot
Copy link

Change https://golang.org/cl/81515 mentions this issue: cmd/go: fix reuse of cached objects during cover

@golang golang locked and limited conversation to collaborators Dec 1, 2018
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

2 participants