Skip to content

cmd/go: go test does not utilize -p setting without prior go build #71365

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
dpanic opened this issue Jan 21, 2025 · 2 comments
Closed

cmd/go: go test does not utilize -p setting without prior go build #71365

dpanic opened this issue Jan 21, 2025 · 2 comments
Labels
BugReport Issues describing a possible bug in the Go implementation. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@dpanic
Copy link

dpanic commented Jan 21, 2025

Go version

go version go1.23.5 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN='/home/user/go/bin'
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE=''
GOPROXY='http://gitlab.lan:3000,https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.5'
GODEBUG='madvdontneed=1'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/user/projects/1681377694/worker/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build142279062=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I executed the following command to run tests without running go build first:

timeout -s KILL 32m xvfb-run -a --server-args="-screen 0 1600x900x24 -noreset" go test -v -json -parallel=1 -p=14 -timeout=2m -count=1 ./... >$REPORT_FILE 2>&1 || true

However, when I include go build before the test command, like this:
go build && timeout -s KILL 32m xvfb-run -a --server-args="-screen 0 1600x900x24 -noreset" go test -v -json -parallel=1 -p=14 -timeout=2m -count=1 ./... >$REPORT_FILE 2>&1 || true

the tests utilize all 14 parallel packages as expected.###

What did you see happen?

When running go test without go build, a maximum of only 2 parallel packages are executed, despite setting -p=14.

What did you expect to see?

I expected go test to utilize 14 parallel packages as specified with -p=14, even without running go build beforehand.

@seankhliao
Copy link
Member

I think we need to see a full reproducer (including the packages it tries to build).
Are the extra command runners necessary to reproduce the issue?

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 21, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Jan 21, 2025
@dpanic dpanic closed this as completed Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants