What version of Go are you using (go version)?
$ go version
go version go1.14rc1 darwin/amd64
Does this issue reproduce with the latest release?
- The bad behavior reported below can be consistently reproduced with go1.14rc1.
- The good behavior reported below can be consistently reproduced with go1.13.8.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mike/Library/Caches/go-build"
GOENV="/Users/mike/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/mike"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/mike/src/github.com/smartystreets/gunit/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/d1/m6l916pn5sn0t3wp5jgy63sr0000gn/T/go-build658210039=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
Consider the following sample program, which runs 10 subtests using t.Parallel():
package example
import (
"fmt"
"testing"
)
func Test(t *testing.T) {
for x := 0; x < 10; x++ {
t.Run("Hello"+fmt.Sprint(x), func(t *testing.T) {
t.Parallel()
t.Log(t.Name())
})
}
}
What did you expect to see?
I expected to see the output aligned with the final report for each subtest, which works
in go1.13.8 (just released earlier today).
$ go version && go test -v
go version go1.13.8 darwin/amd64
=== RUN Test
=== RUN Test/Hello0
=== PAUSE Test/Hello0
=== RUN Test/Hello1
=== PAUSE Test/Hello1
=== RUN Test/Hello2
=== PAUSE Test/Hello2
=== RUN Test/Hello3
=== PAUSE Test/Hello3
=== RUN Test/Hello4
=== PAUSE Test/Hello4
=== RUN Test/Hello5
=== PAUSE Test/Hello5
=== RUN Test/Hello6
=== PAUSE Test/Hello6
=== RUN Test/Hello7
=== PAUSE Test/Hello7
=== RUN Test/Hello8
=== PAUSE Test/Hello8
=== RUN Test/Hello9
=== PAUSE Test/Hello9
=== CONT Test/Hello0
=== CONT Test/Hello5
=== CONT Test/Hello9
=== CONT Test/Hello8
=== CONT Test/Hello4
=== CONT Test/Hello3
=== CONT Test/Hello2
=== CONT Test/Hello1
=== CONT Test/Hello7
=== CONT Test/Hello6
--- PASS: Test (0.00s)
--- PASS: Test/Hello0 (0.00s)
stuff_test.go:12: Test/Hello0
--- PASS: Test/Hello5 (0.00s)
stuff_test.go:12: Test/Hello5
--- PASS: Test/Hello9 (0.00s)
stuff_test.go:12: Test/Hello9
--- PASS: Test/Hello8 (0.00s)
stuff_test.go:12: Test/Hello8
--- PASS: Test/Hello4 (0.00s)
stuff_test.go:12: Test/Hello4
--- PASS: Test/Hello3 (0.00s)
stuff_test.go:12: Test/Hello3
--- PASS: Test/Hello2 (0.00s)
stuff_test.go:12: Test/Hello2
--- PASS: Test/Hello1 (0.00s)
stuff_test.go:12: Test/Hello1
--- PASS: Test/Hello7 (0.00s)
stuff_test.go:12: Test/Hello7
--- PASS: Test/Hello6 (0.00s)
stuff_test.go:12: Test/Hello6
PASS
ok example 0.086s
What did you see instead?
Notice that in go1.14rc1 the test log output appears in unexpected places in the
overall verbose output. This change in behavior makes the output more difficult to decipher for
humans and causes test log output to be lost when scanned by test runners in
editors and IDEs (such as Intellij GoLand).
$ go version && go test -v
go version go1.14rc1 darwin/amd64
=== RUN Test
=== RUN Test/Hello0
=== PAUSE Test/Hello0
=== RUN Test/Hello1
=== PAUSE Test/Hello1
=== RUN Test/Hello2
=== PAUSE Test/Hello2
=== RUN Test/Hello3
=== PAUSE Test/Hello3
=== RUN Test/Hello4
=== PAUSE Test/Hello4
=== RUN Test/Hello5
=== PAUSE Test/Hello5
=== RUN Test/Hello6
=== PAUSE Test/Hello6
=== RUN Test/Hello7
=== PAUSE Test/Hello7
=== RUN Test/Hello8
=== PAUSE Test/Hello8
=== RUN Test/Hello9
=== PAUSE Test/Hello9
=== CONT Test/Hello0
Test/Hello0: stuff_test.go:12: Test/Hello0
=== CONT Test/Hello5
=== CONT Test/Hello4
Test/Hello4: stuff_test.go:12: Test/Hello4
=== CONT Test/Hello3
Test/Hello5: stuff_test.go:12: Test/Hello5
Test/Hello3: stuff_test.go:12: Test/Hello3
=== CONT Test/Hello8
Test/Hello8: stuff_test.go:12: Test/Hello8
=== CONT Test/Hello2
Test/Hello2: stuff_test.go:12: Test/Hello2
=== CONT Test/Hello7
=== CONT Test/Hello1
Test/Hello7: stuff_test.go:12: Test/Hello7
Test/Hello1: stuff_test.go:12: Test/Hello1
=== CONT Test/Hello6
Test/Hello6: stuff_test.go:12: Test/Hello6
=== CONT Test/Hello9
Test/Hello9: stuff_test.go:12: Test/Hello9
--- PASS: Test (0.00s)
--- PASS: Test/Hello0 (0.00s)
--- PASS: Test/Hello4 (0.00s)
--- PASS: Test/Hello5 (0.00s)
--- PASS: Test/Hello3 (0.00s)
--- PASS: Test/Hello8 (0.00s)
--- PASS: Test/Hello2 (0.00s)
--- PASS: Test/Hello7 (0.00s)
--- PASS: Test/Hello1 (0.00s)
--- PASS: Test/Hello6 (0.00s)
--- PASS: Test/Hello9 (0.00s)
PASS
ok example 0.915s
This feels very much like a newly-introduced bug.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
Consider the following sample program, which runs 10 subtests using
t.Parallel():What did you expect to see?
I expected to see the output aligned with the final report for each subtest, which works
in go1.13.8 (just released earlier today).
What did you see instead?
Notice that in go1.14rc1 the test log output appears in unexpected places in the
overall verbose output. This change in behavior makes the output more difficult to decipher for
humans and causes test log output to be lost when scanned by test runners in
editors and IDEs (such as Intellij GoLand).
This feels very much like a newly-introduced bug.