Skip to content

x/xerrors: tests broken (via vet error) with go1.15rc1 #40536

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
rhysh opened this issue Aug 2, 2020 · 7 comments
Closed

x/xerrors: tests broken (via vet error) with go1.15rc1 #40536

rhysh opened this issue Aug 2, 2020 · 7 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@rhysh
Copy link
Contributor

rhysh commented Aug 2, 2020

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

$ go1.15 version
go version go1.15rc1 darwin/amd64
$ go1.14 version
go version go1.14.6 darwin/amd64

Does this issue reproduce with the latest release?

The issue is present in the latest release candidate, go1.15rc1. It is a regression from the latest release, go1.14.6.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/rhys/Library/Caches/go-build"
GOENV="/Users/rhys/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/rhys/go/pkg/mod"
GONOPROXY="*"
GONOSUMDB="*"
GOOS="darwin"
GOPATH="/Users/rhys/go"
GOPRIVATE="*"
GOPROXY="direct"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/tmp/xerr/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/49/zmds5zsn75z1283vtzxyfr5hj7yjq4/T/go-build982147191=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ mkdir /tmp/xerr && cd /tmp/xerr && go mod init xerr
go: creating new go.mod: module xerr

$ go get golang.org/x/xerrors@master
go: golang.org/x/xerrors master => v0.0.0-20191204190536-9bdfabe68543

$ go1.15 test golang.org/x/xerrors
# golang.org/x/xerrors_test
/Users/rhys/go/pkg/mod/golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543/fmt_test.go:398:43: Sprint arg e causes recursive call to Error method
FAIL	golang.org/x/xerrors [build failed]
FAIL

$ go1.14 test golang.org/x/xerrors
ok  	golang.org/x/xerrors	0.302s

$ go1.15 version
go version go1.15rc1 darwin/amd64

$ go1.14 version
go version go1.14.6 darwin/amd64

What did you expect to see?

I expected the tests for the golang.org/x/errors package to succeed without errors.

What did you see instead?

A new vet check in Go 1.15, enabled by default when running tests, detects what looks like a bug in a type that x/xerrors defines for the purpose of testing itself. https://github.com/golang/xerrors/blob/9bdfabe68543/fmt_test.go#L398

@gopherbot gopherbot added this to the Unreleased milestone Aug 2, 2020
@bcmills
Copy link
Contributor

bcmills commented Aug 4, 2020

I can reproduce this locally using go1.15rc1. Should be an easy fix.

@bcmills
Copy link
Contributor

bcmills commented Aug 4, 2020

release-blocker for Go 1.15 via #11811.

@bcmills bcmills modified the milestones: Unreleased, Go1.15 Aug 4, 2020
@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. release-blocker Testing An issue that has been verified to require only test changes, not just a test failure. labels Aug 4, 2020
@bcmills
Copy link
Contributor

bcmills commented Aug 4, 2020

CC @toothrot

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/246640 mentions this issue: xerrors: avoid infinite loop in test (detailed).Error method

@bcmills
Copy link
Contributor

bcmills commented Aug 4, 2020

Should be fixed at head, but may need a backport to release-branch.go1.15.

#37020 is the issue to add this repo to the build dashboard.

@bcmills
Copy link
Contributor

bcmills commented Aug 4, 2020

@gopherbot, please backport to 1.15.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #40573 (for 1.15).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants