Skip to content
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

cmd/go: TestScript/get_update_unknown_protocol test fails [1.15] #43861

Closed
dmitshur opened this issue Jan 22, 2021 · 3 comments
Closed

cmd/go: TestScript/get_update_unknown_protocol test fails [1.15] #43861

dmitshur opened this issue Jan 22, 2021 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@dmitshur
Copy link
Contributor

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

$ go version
go version go1.15.7 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

It can be reproduced in Go 1.15.7 and also Go 1.15.6, although it did not reproduce with Go 1.15.6 when it was released, which suggests something external changed (maybe a new v0.1.0 tag or rewritten history in x/tools).

(Go 1.14 doesn't have this test.)

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dmitshur/Library/Caches/go-build"
GOENV="/Users/dmitshur/Library/Application Support/go/env"
GOEXE=""
GOFLAGS="-mod=readonly"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/dmitshur/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/dmitshur/go"
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=""
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/zb/5p8cwfhj29gf_m8vdy8ylmlr00jwcj/T/go-build049596360=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ go test -v -count=1 -run='TestScript/get_update_unknown_protocol' cmd/go

What did you expect to see?

A passing test, like on tip.


=== RUN   TestScript
=== RUN   TestScript/get_update_unknown_protocol
=== PAUSE TestScript/get_update_unknown_protocol
=== CONT  TestScript/get_update_unknown_protocol
go test proxy running at GOPROXY=http://127.0.0.1:49412/mod
    script_test.go:213: 
        WORK=$WORK
        PATH=/var/folders/zb/5p8cwfhj29gf_m8vdy8ylmlr00jwcj/T/cmd-go-test-354286626/tmpdir1343679603/testbin:/Users/dmitshur/gotip/bin:/Users/dmitshur/google-cloud-sdk/bin:/Users/dmitshur/homebrew/bin:/Users/dmitshur/homebrew/sbin:/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/dmitshur/go/bin:/Users/dmitshur/bin
        HOME=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
        GOCACHE=/Users/dmitshur/Library/Caches/go-build
        GODEBUG=
        GOEXE=
        GOEXPSTRING=none
        GOOS=darwin
        GOPATH=$WORK/gopath
        GOPROXY=http://127.0.0.1:49412/mod
        GOPRIVATE=
        GOROOT=/Users/dmitshur/gotip
        GOROOT_FINAL=
        TESTGO_GOROOT=/Users/dmitshur/gotip
        GOSUMDB=localhost.localdev/sumdb+00000c67+AcTrnkbUA+TU4heY3hkjiSES/DSQniBqIeQ/YppAUtK6
        GONOPROXY=
        GONOSUMDB=
        GOVCS=*:all
        PWD=$WORK/gopath/src
        TMPDIR=$WORK/tmp
        devnull=/dev/null
        goversion=1.16
        :=:
        
        > [!net] skip
        > [!exec:git] skip
        > env GO111MODULE=off
        # Clone the repo via HTTPS manually. (0.507s)
        > exec git clone -q https://github.com/golang/example github.com/golang/example
        # Configure the repo to use a protocol unknown to cmd/go
        # that still actually works. (1.956s)
        > cd github.com/golang/example
        $WORK/gopath/src/github.com/golang/example
        > exec git remote set-url origin xyz://github.com/golang/example
        > exec git config --local url.https://github.com/.insteadOf xyz://github.com/
        > go get -d -u -f github.com/golang/example/hello
        PASS
        
--- PASS: TestScript (0.01s)
    --- PASS: TestScript/get_update_unknown_protocol (2.55s)
PASS
ok  	cmd/go	4.290s

What did you see instead?

A failing test.

=== RUN   TestScript
=== RUN   TestScript/get_update_unknown_protocol
=== PAUSE TestScript/get_update_unknown_protocol
=== CONT  TestScript/get_update_unknown_protocol
go test proxy running at GOPROXY=http://127.0.0.1:49311/mod
go proxy: open /usr/local/go/src/cmd/go/testdata/mod/golang.org_x_tools_v0.0.0-20210112183307-1e6ecd4bf1b0.txt: no such file or directory
go proxy: no archive golang.org/x/tools v0.0.0-20210112183307-1e6ecd4bf1b0: file does not exist
    script_test.go:210: 
        WORK=$WORK
        PATH=/var/folders/zb/5p8cwfhj29gf_m8vdy8ylmlr00jwcj/T/cmd-go-test-301557091/tmpdir171918694/testbin:/Users/dmitshur/google-cloud-sdk/bin:/Users/dmitshur/homebrew/bin:/Users/dmitshur/homebrew/sbin:/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/dmitshur/go/bin:/Users/dmitshur/bin
        HOME=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
        GOCACHE=/Users/dmitshur/Library/Caches/go-build
        GODEBUG=
        GOEXE=
        GOEXPSTRING=framepointer
        GOOS=darwin
        GOPATH=$WORK/gopath
        GOPROXY=http://127.0.0.1:49311/mod
        GOPRIVATE=
        GOROOT=/usr/local/go
        GOROOT_FINAL=
        TESTGO_GOROOT=/usr/local/go
        GOSUMDB=localhost.localdev/sumdb+00000c67+AcTrnkbUA+TU4heY3hkjiSES/DSQniBqIeQ/YppAUtK6
        GONOPROXY=
        GONOSUMDB=
        PWD=$WORK/gopath/src
        TMPDIR=$WORK/tmp
        devnull=/dev/null
        goversion=1.15
        :=:
        
        > [!net] skip
        > [!exec:git] skip
        # Clone the repo via HTTPS manually. (0.532s)
        > exec git clone -q https://github.com/golang/example github.com/golang/example
        # Configure the repo to use a protocol unknown to cmd/go
        # that still actually works. (0.038s)
        > cd github.com/golang/example
        $WORK/gopath/src/github.com/golang/example
        > exec git remote set-url origin xyz://github.com/golang/example
        > exec git config --local url.https://github.com/.insteadOf xyz://github.com/
        > go get -d -u -f github.com/golang/example/hello
        [stderr]
        go get: -f flag is a no-op when using modules
        go: golang.org/x/tools@v0.0.0-20210112183307-1e6ecd4bf1b0: reading http://127.0.0.1:49311/mod/golang.org/x/tools/@v/v0.0.0-20210112183307-1e6ecd4bf1b0.mod: 404 Not Found
        	server response: 404 page not found
        [exit status 1]
        FAIL: testdata/script/get_update_unknown_protocol.txt:13: unexpected command failure
        
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/get_update_unknown_protocol (0.61s)
FAIL
FAIL	cmd/go	2.483s
FAIL

Also see the linux-386-longtest and linux-amd64-longtest builders at https://build.golang.org/?repo=&branch=release-branch.go1.15.

CC @jayconrod, @bcmills, @matloob, @rolandshoemaker.

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Jan 22, 2021
@dmitshur dmitshur added this to the Backlog milestone Jan 22, 2021
@jayconrod jayconrod self-assigned this Jan 22, 2021
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/285956 mentions this issue: [release-branch.go1.15] cmd/go: fix get_update_unknown_protocol test

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 22, 2021
@dmitshur dmitshur modified the milestones: Backlog, Go1.15.8 Jan 22, 2021
@dmitshur dmitshur changed the title cmd/go: TestScript/get_update_unknown_protocol test fails on release-branch.go1.15 cmd/go: TestScript/get_update_unknown_protocol test fails [1.15] Jan 22, 2021
@dmitshur dmitshur added the CherryPickApproved Used during the release process for point releases label Jan 22, 2021
@dmitshur
Copy link
Contributor Author

Approved as a test fix. Only Go 1.15 needs the fix.

gopherbot pushed a commit that referenced this issue Jan 22, 2021
This test needs to run in GOPATH mode. It broke when a go.mod file was
added to github.com/golang/example. This change sets GO111MODULE=off,
which matches master since CL 255051.

Fixes #43861

Change-Id: I9ea109a99509fac3185756a0f0d852a84c677bf5
Reviewed-on: https://go-review.googlesource.com/c/go/+/285956
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
@gopherbot
Copy link
Contributor

Closed by merging 9bb97ea to release-branch.go1.15.

@golang golang locked and limited conversation to collaborators Jan 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. 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