-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Description
Go version
go version go1.25.1 darwin/arm64
Output of go env
in your module/workspace:
AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='/Users/user/.local/bin'
GOCACHE='/Users/user/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/user/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/nq/hthkfj251hg0ztkft_466swm0000gp/T/go-build1211461686=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/djones/repo/go.mod'
GOMODCACHE='/Users/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/user/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.25.1/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/user/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.25.1/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.1'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
I've got a test like this:
func TestSyncPath(t *testing.T) {
synctest.Test(t, func(*testing.T) {
panic("uh oh")
})
}
It fails, as expected.
Nearly identical test, without synctest
also fails, like this:
func TestSyncPath(t *testing.T) {
panic("uh oh")
}
What did you see happen?
Output from the test with synctest
looks like:
panic: uh oh [recovered, repanicked]
goroutine 5 [running, synctest bubble 1]:
testing.tRunner.func1.2({0x1030f4d20, 0x103125840})
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1872 +0x190
testing.tRunner.func1()
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1875 +0x31c
panic({0x1030f4d20?, 0x103125840?})
/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/panic.go:783 +0x120
repo1.dso.mil/ironbank-tools/products/vulnerability-assessment-tracker/vat-go-microservices/microservice-monorepo/cmd.TestSyncPath.func1(0x140000036c0?)
/Users/djones/Documents/repos/ironbank-tools/products/vulnerability-assessment-tracker/microservice-monorepo/cmd/foo_test.go:10 +0x2c
testing.tRunner(0x140000036c0, 0x103124d90)
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1934 +0xc8
created by testing/synctest.testingSynctestTest in goroutine 4
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:2046 +0x1fc
FAIL repo1.dso.mil/ironbank-tools/products/vulnerability-assessment-tracker/vat-go-microservices/microservice-monorepo/cmd 0.274s
FAIL
Output without synctest
looks like:
--- FAIL: TestSyncPath (0.00s)
panic: uh oh [recovered, repanicked]
goroutine 20 [running]:
testing.tRunner.func1.2({0x104aacd20, 0x104add710})
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1872 +0x190
testing.tRunner.func1()
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1875 +0x31c
panic({0x104aacd20?, 0x104add710?})
/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/panic.go:783 +0x120
repo1.dso.mil/ironbank-tools/products/vulnerability-assessment-tracker/vat-go-microservices/microservice-monorepo/cmd.TestSyncPath(0x1400008aa80?)
/Users/djones/Documents/repos/ironbank-tools/products/vulnerability-assessment-tracker/microservice-monorepo/cmd/foo_test.go:8 +0x2c
testing.tRunner(0x1400008aa80, 0x104adcc00)
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1934 +0xc8
created by testing.(*T).Run in goroutine 1
/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1997 +0x364
FAIL repo1.dso.mil/ironbank-tools/products/vulnerability-assessment-tracker/vat-go-microservices/microservice-monorepo/cmd 0.281s
FAIL
What did you expect to see?
Only issue really is that the --- FAIL: TestSyncPath (0.00s)
header is missing from the output with synctest
. While fairly minor, it does make scanning test results difficult in a file with many tests.
meling
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.