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 -parallel=1 (disable parallel tests?) output is confusing #18118

Closed
smcquay opened this issue Nov 30, 2016 · 3 comments
Closed
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@smcquay
Copy link
Contributor

smcquay commented Nov 30, 2016

The tool behaves correctly but the output is misleading.

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

go version go1.7.3 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/sm"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zv/dcwk1sd562z4rcl72g3vygqh0000gn/T/go-build135886187=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

https://play.golang.org/p/uNOBr95MKU

then run

go test -v -parallel 1

What did you expect to see?

=== RUN   TestA
--- PASS: TestA (1.00s)
	foo_test.go:9: A
=== RUN   TestB
--- PASS: TestB (1.00s)
	foo_test.go:14: B
=== RUN   TestC
--- PASS: TestC (1.00s)
	foo_test.go:19: C
=== RUN   TestD
--- PASS: TestD (1.00s)
	foo_test.go:24: D
=== RUN   TestE
--- PASS: TestE (1.01s)
	foo_test.go:29: E
PASS
ok  	mcquay.me/ptest	5.023s

What did you see instead?

go test -v -parallel 1                                                                                                          
=== RUN   TestA
=== RUN   TestB
=== RUN   TestC
=== RUN   TestD
=== RUN   TestE
--- PASS: TestA (1.00s)
	foo_test.go:10: A
--- PASS: TestD (1.00s)
	foo_test.go:28: D
--- PASS: TestE (1.00s)
	foo_test.go:34: E
--- PASS: TestC (1.00s)
	foo_test.go:22: C
--- PASS: TestB (1.00s)
	foo_test.go:16: B
PASS
ok  	mcquay.me/ptest	5.011s

Note that it truly runs the tests serially, but the bunch of ===RUN output at the beginning makes one think it's still running in parallel.

@bradfitz bradfitz added this to the Go1.9 milestone Nov 30, 2016
@bradfitz bradfitz changed the title go test -parallel=1 (disable parallel tests?) output is confusing cmd/go: go test -parallel=1 (disable parallel tests?) output is confusing Nov 30, 2016
@bradfitz bradfitz added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Nov 30, 2016
@bradfitz
Copy link
Contributor

Thanks. We can look into this when the tree opens in February. We're frozen for the Go 1.8 release at the moment.

@ALTree
Copy link
Member

ALTree commented Jun 2, 2017

This is a dup of #19280. Closing this one since the other issue has much more discussion and a CL.

@ALTree ALTree closed this as completed Jun 2, 2017
@mvdan
Copy link
Member

mvdan commented Jun 2, 2017

Nicely spotted, @ALTree. I even gave my thumbs up to this issue, but apparently forgot about it when opening the other one a few months later.

@golang golang locked and limited conversation to collaborators Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants