Skip to content

cmd/go: adding -cover to "go test -n" can cause spurious failures #67952

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

Closed
thanm opened this issue Jun 12, 2024 · 2 comments
Closed

cmd/go: adding -cover to "go test -n" can cause spurious failures #67952

thanm opened this issue Jun 12, 2024 · 2 comments
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@thanm
Copy link
Contributor

thanm commented Jun 12, 2024

On tip, invoking "go test -n -cover ./..." on a collection of packages that include at least one package with code but no tests can result in a spurious errors. Example:

$ cd `go env GOROOT`
$ cd src/internal/coverage
$ go test -n -cover ./...
...
internal/coverage/uleb128: open $WORK/b112/covmeta.b07a5f2dff1231cae3a6bdd70c8cc7c19da16abf8ac59747d8e9859c03594d37: no such file or directory
$ echo $?
1
$

This obviously shouldn't be happening for a "-n" test run (works fine without -cover).

@thanm thanm added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 12, 2024
@thanm thanm added this to the Go1.23 milestone Jun 12, 2024
@thanm thanm self-assigned this Jun 12, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/592201 mentions this issue: cmd/go: fix "go test -n -cover" glitch with no-test packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants