go: cmd/go: long test fails (TestAccidentalGitCheckout)
What version of Go are you using (go version
)?
go version devel +2767c4e285 Fri Mar 16 21:01:28 2018 +0000 darwin/amd64
What operating system and processor architecture are you using (go env
)?
go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/thorn/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/thorn/go"
GORACE=""
GOROOT="/Users/thorn/golang"
GOTMPDIR=""
GOTOOLDIR="/Users/thorn/golang/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/km/50gy6_q557v6_7vxbf9b29v00000gn/T/go-build428090470=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
Running ./all.bash does not fail in any of tests: ALL TESTS PASSED
.
When I run go test cmd/go
I get these failed tests:
~/golang/src % go test cmd/go
--- FAIL: TestGoBuildDashAInDevBranch (0.30s)
go_test.go:833: running testgo [install math]
go_test.go:835: running testgo [build -v -a math]
go_test.go:835: standard error:
go_test.go:835: internal/cpu
math
go_test.go:836: testgo build -a math in dev branch DID NOT build runtime, but should have
go_test.go:836: pattern runtime not found in standard error
--- FAIL: TestGoBuildDashAInReleaseBranch (0.47s)
go_test.go:849: running testgo [install math net/http]
go_test.go:851: running testgo [install -v -a math]
go_test.go:851: standard error:
go_test.go:851: internal/cpu
math
go_test.go:852: testgo build -a math in release branch DID NOT build runtime, but should have
go_test.go:852: pattern runtime not found in standard error
--- FAIL: TestNewReleaseRebuildsStalePackagesInGOPATH (3.13s)
go_test.go:892: running testgo [install -a p1]
go_test.go:893: running testgo [list -f {{.Stale}}:{{.StaleReason}} p1]
go_test.go:893: standard output:
go_test.go:893: false:
go_test.go:902: running testgo [list -f {{.Stale}}:{{.StaleReason}} p1]
go_test.go:902: standard output:
go_test.go:902: false:
go_test.go:909: running testgo [list -f {{.Stale}}:{{.StaleReason}} p1]
go_test.go:909: standard output:
go_test.go:909: false:
go_test.go:909: ./testgo list claims p1 is NOT stale, incorrectly, after changing sys.go
--- FAIL: TestBuildIDContainsArchModeEnv (2.62s)
--- FAIL: TestBuildIDContainsArchModeEnv/386 (1.23s)
go_test.go:4716: running testgo [install mycmd]
go_test.go:4718: running testgo [list -f {{.Stale}}:{{.StaleReason}} mycmd]
go_test.go:4718: standard output:
go_test.go:4718: true:stale dependency: runtime
go_test.go:4718: wrong reason for Stale=true: "stale dependency: runtime", want "stale dependency: runtime/internal/sys"
--- FAIL: TestBuildIDContainsArchModeEnv/arm (1.39s)
go_test.go:4716: running testgo [install mycmd]
go_test.go:4718: running testgo [list -f {{.Stale}}:{{.StaleReason}} mycmd]
go_test.go:4718: standard output:
go_test.go:4718: true:stale dependency: runtime
go_test.go:4718: wrong reason for Stale=true: "stale dependency: runtime", want "stale dependency: runtime/internal/sys"
--- FAIL: TestAccidentalGitCheckout (0.85s)
go_test.go:1465: running testgo [get -u vcs-test.golang.org/go/test1-svn-git]
go_test.go:1465: standard error:
go_test.go:1465: package vcs-test.golang.org/go/test1-svn-git: unrecognized import path "vcs-test.golang.org/go/test1-svn-git" (https fetch: Get https://vcs-test.golang.org/go/test1-svn-git?go-get=1: x509: certificate has expired or is not yet valid)
go_test.go:1465: testgo failed as expected: exit status 1
go_test.go:1466: get did not fail for right reason
go_test.go:1466: pattern src[\\/]vcs-test.* uses git, but parent .*src[\\/]vcs-test.* uses svn not found in standard error
--- FAIL: TestMoveHG (0.37s)
go_test.go:1272: running testgo [get -d vcs-test.golang.org/go/custom-hg-hello]
go_test.go:1272: standard error:
go_test.go:1272: package vcs-test.golang.org/go/custom-hg-hello: unrecognized import path "vcs-test.golang.org/go/custom-hg-hello" (https fetch: Get https://vcs-test.golang.org/go/custom-hg-hello?go-get=1: x509: certificate has expired or is not yet valid)
go_test.go:1272: go [get -d vcs-test.golang.org/go/custom-hg-hello] failed unexpectedly: exit status 1
FAIL
FAIL cmd/go 268.072s
Also it takes 268 seconds compared to all.bash: ok cmd/go 59.136s
What did you expect to see?
No errors.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (14 by maintainers)
Commits related to this issue
- cmd/go: fix the rebuilding stale packages test Non-main packages do not depend on the "runtime" package, but main packages still do. Use a main package in the test. This change passes the -i flag to... — committed to golang/go by ysmolski 6 years ago
- cmd/go: fix TestBuildIDContainsArchModeEnv Changing GOARCH, GOARM, GO386 leads to a stale dependency. Updates #24436. Change-Id: I5b5b3fca6401be50fa81fb040bc56356de7555de Reviewed-on: https://go-re... — committed to golang/go by ysmolski 6 years ago
- cmd/go: make TestNewReleaseRebuildsStalePackagesInGOPATH pass again The test TestNewReleaseRebuildsStalePackagesInGOPATH is not run in short mode, so people tend to not notice when it fails. It was f... — committed to golang/go by ianlancetaylor 6 years ago
To add another data point, I can reproduce this on tip on linux/amd64.
This is expected because
all.bash
runs the tests using the-short
flag. Time-consuming tests that are skipped byall.bash
get executed when you manually rungo test
.