Skip to content

testing: TestChdir/relative failed due to symlink GOROOT path #72864

Open
@linsite

Description

@linsite

Go version

go version devel go1.25-b143c98169 Wed Mar 12 18:18:03 2025 -0700 linux/arm64

Output of go env in your module/workspace:

shell
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE='on'
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/ulin/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/ulin/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build448681645=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/ulin/gosrc/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/ulin/gosrc'
GOPRIVATE=''
GOPROXY='https://goproxy.cn'
GOROOT='/home/ulin/g/golang'
GOSUMDB='off'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/ulin/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/ulin/g/golang/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='devel go1.25-b143c98169 Wed Mar 12 18:18:03 2025 -0700'
GOWORK=''
PKG_CONFIG='pkg-config'


more:

go repository absolute path is: /mnt/data/lean/g/golang, there is a symlink for /mnt/data/lean/g under /home/ulin/ which is /home/ulin/g

What did you do?

  1. cd /home/ulin/g/golang && bash build.bash
  2. invoke go tool dist test -v testing

What did you see happen?

$ go tool dist test -v testing
                                                                                                                                                                                            ##### Test execution environment.
# GOARCH: arm64
# CPU:
# GOOS: linux
# OS Version: Linux 5.8.18v1 #6 SMP PREEMPT Mon Dec 2 23:42:15 CST 2024 aarch64
                                                                                                                                                                                            ##### Testing packages.
# go tool dist test -run=^testing$
--- FAIL: TestChdir (0.00s)
    --- FAIL: TestChdir/relative (0.00s)
        testing.go:1361: chdir ../../../../../../tmp/TestChdir2779019320/001: no such file or directory
FAIL
FAIL    testing 1.035s
FAIL
# go tool dist test -run=^testing$
go tool dist: Failed: exit status 1

What did you expect to see?

should pass

more:
go test testing -run TestChdir failed, too.

$ go test testing -run TestChdir
--- FAIL: TestChdir (0.00s)
    --- FAIL: TestChdir/relative (0.00s)
        testing.go:1361: chdir ../../../../../../tmp/TestChdir667226533/001: no such file or directory
FAIL
FAIL    testing 0.012s
FAIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions