Skip to content

cmd/go: remove test dependency on gopkg.in service #54503

@bcmills

Description

@bcmills
Contributor
#!watchflakes
post <- pkg == "cmd/go" && test == "TestScript" && (`reading https://gopkg\.in` || `https fetch: Get "https://gopkg\.in`)

The gopkg.in service has occasional downtime (most recently niemeyer/gopkg#78).
Some of the cmd/go tests of gopkg.in modules are isolated from outages by the Go module proxy, but unfortunately others fail when the service is down.

As far as I can tell, the go-import metadata served by gopkg.in is mostly static. (It may add some value in serving up-to-date go-source metadata, but cmd/go does not depend on that metadata.) Since we're going to have a test-local HTTPS server anyway for #27494, perhaps we can migrate the gopkg.in tests to use that server with static go-import metadata instead.

Activity

heschi

heschi commented on Aug 17, 2022

@heschi
Contributor

In this particular case I think GitHub was down...

gopherbot

gopherbot commented on Aug 17, 2022

@gopherbot
Contributor

Change https://go.dev/cl/424594 mentions this issue: cmd/go: disable test cases that depend on gopkg.in

bcmills

bcmills commented on Aug 17, 2022

@bcmills
ContributorAuthor

I've been having trouble with -longtest TryBots all day, and it's only the gopkg.in tests that are flaking.

(It may be that the underlying problem is on GitHub's side, but it doesn't seem to affect the GitHub-only tests. And long-term we may want to reduce our dependence on those too.)

added
TestingAn issue that has been verified to require only test changes, not just a test failure.
on Aug 17, 2022
added
NeedsFixThe path to resolution is known, but the work has not been done.
on Aug 18, 2022
added this to the Go1.20 milestone on Aug 20, 2022
moved this to Active in Test Flakeson Oct 25, 2022
gopherbot

gopherbot commented on Oct 25, 2022

@gopherbot
Contributor

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "cmd/go" && test == "TestScript" && `reading https://gopkg\.in`
2022-09-09 00:28 linux-386-longtest go@3c33c3b3 cmd/go.TestScript (log)
go test proxy running at GOPROXY=http://127.0.0.1:32793/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/mod_replace_gopkgin (13.05s)
        script_test.go:282: 
            # (2022-09-09T01:03:47Z)
            # Regression test for golang.org/issue/34254:
            # a clone of gopkg.in/[…].vN should be replaceable by
            # a fork hosted at corp.example.com/[…]/vN,
            # even if there is an explicit go.mod file containing the
            # gopkg.in path. (0.000s)
            # Replacing gopkg.in/[…].vN with a repository with a root go.mod file
            # specifying […].vN and a compatible version should succeed, even if
            # the replacement path is not a gopkg.in path. (12.894s)
            > cd 4-to-4
            $WORK/gopath/src/4-to-4
            > go list -m gopkg.in/src-d/go-git.v4
            [stderr]
            go: gopkg.in/src-d/go-git.v4@v4.13.1 requires
            	gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127: unrecognized import path "gopkg.in/check.v1": reading https://gopkg.in/check.v1?go-get=1: 502 Bad Gateway
            	server response: Cannot obtain refs from GitHub: cannot talk to GitHub: Get https://github.com/go-check/check.git/info/refs?service=git-upload-pack: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
            [exit status 1]
            FAIL: testdata/script/mod_replace_gopkgin.txt:20: unexpected command failure
2022-09-27 21:10 linux-386-longtest go@4360fd8d cmd/go.TestScript (log)
go test proxy running at GOPROXY=http://127.0.0.1:43583/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/mod_replace_gopkgin (13.38s)
        script_test.go:282: 
            # (2022-09-27T22:25:00Z)
            # Regression test for golang.org/issue/34254:
            # a clone of gopkg.in/[…].vN should be replaceable by
            # a fork hosted at corp.example.com/[…]/vN,
            # even if there is an explicit go.mod file containing the
            # gopkg.in path. (0.000s)
            # Replacing gopkg.in/[…].vN with a repository with a root go.mod file
            # specifying […].vN and a compatible version should succeed, even if
            # the replacement path is not a gopkg.in path. (13.259s)
            > cd 4-to-4
            $WORK/gopath/src/4-to-4
            > go list -m gopkg.in/src-d/go-git.v4
            [stderr]
            go: gopkg.in/src-d/go-git.v4@v4.13.1 requires
            	gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127: unrecognized import path "gopkg.in/check.v1": reading https://gopkg.in/check.v1?go-get=1: 502 Bad Gateway
            	server response: Cannot obtain refs from GitHub: cannot talk to GitHub: Get https://github.com/go-check/check.git/info/refs?service=git-upload-pack: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
            [exit status 1]
            FAIL: testdata/script/mod_replace_gopkgin.txt:20: unexpected command failure
2022-09-27 21:14 linux-amd64-longtest go@3b5188ed cmd/go.TestScript (log)
go test proxy running at GOPROXY=http://127.0.0.1:36693/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/mod_replace_gopkgin (13.01s)
        script_test.go:282: 
            # (2022-09-27T22:26:18Z)
            # Regression test for golang.org/issue/34254:
            # a clone of gopkg.in/[…].vN should be replaceable by
            # a fork hosted at corp.example.com/[…]/vN,
            # even if there is an explicit go.mod file containing the
            # gopkg.in path. (0.000s)
            # Replacing gopkg.in/[…].vN with a repository with a root go.mod file
            # specifying […].vN and a compatible version should succeed, even if
            # the replacement path is not a gopkg.in path. (12.818s)
            > cd 4-to-4
            $WORK/gopath/src/4-to-4
            > go list -m gopkg.in/src-d/go-git.v4
            [stderr]
            go: gopkg.in/src-d/go-git.v4@v4.13.1 requires
            	gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127: unrecognized import path "gopkg.in/check.v1": reading https://gopkg.in/check.v1?go-get=1: 502 Bad Gateway
            	server response: Cannot obtain refs from GitHub: cannot talk to GitHub: Get https://github.com/go-check/check.git/info/refs?service=git-upload-pack: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
            [exit status 1]
            FAIL: testdata/script/mod_replace_gopkgin.txt:20: unexpected command failure

watchflakes

gopherbot

gopherbot commented on Nov 17, 2022

@gopherbot
Contributor

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "cmd/go" && test == "TestScript" && `reading https://gopkg\.in`
2022-11-16 14:38 linux-amd64-longtest-race go@7c8c209b cmd/go.TestScript (log)
vcs-test.golang.org rerouted to http://127.0.0.1:42431
https://vcs-test.golang.org rerouted to https://127.0.0.1:42193
go test proxy running at GOPROXY=http://127.0.0.1:43215/mod
2022/11/16 16:59:51 http: TLS handshake error from 127.0.0.1:36250: EOF
2022/11/16 16:59:51 http: TLS handshake error from 127.0.0.1:36246: EOF
--- FAIL: TestScript (0.15s)
    --- FAIL: TestScript/mod_replace_gopkgin (15.04s)
        script_test.go:134: 2022-11-16T16:59:20Z
        script_test.go:136: $WORK=/workdir/tmp/cmd-go-test-420504610/tmpdir530274409/mod_replace_gopkgin2406147624
        script_test.go:154: 
            # Regression test for golang.org/issue/34254:
            # a clone of gopkg.in/[…].vN should be replaceable by
            # a fork hosted at corp.example.com/[…]/vN,
            # even if there is an explicit go.mod file containing the
            # gopkg.in path. (0.000s)
            # Replacing gopkg.in/[…].vN with a repository with a root go.mod file
            # specifying […].vN and a compatible version should succeed, even if
            # the replacement path is not a gopkg.in path. (14.744s)
            > cd 4-to-4
            > go list -m gopkg.in/src-d/go-git.v4
            [stderr]
            go: gopkg.in/src-d/go-git.v4@v4.13.1 requires
            	gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127: unrecognized import path "gopkg.in/check.v1": reading https://gopkg.in/check.v1?go-get=1: 502 Bad Gateway
            	server response: Cannot obtain refs from GitHub: cannot talk to GitHub: Get https://github.com/go-check/check.git/info/refs?service=git-upload-pack: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
        script_test.go:154: FAIL: mod_replace_gopkgin.txt:20: go list -m gopkg.in/src-d/go-git.v4: exit status 1
2022-11-16 16:25 linux-386-longtest go@38218f39 cmd/go.TestScript (log)
vcs-test.golang.org rerouted to http://127.0.0.1:41359
https://vcs-test.golang.org rerouted to https://127.0.0.1:41029
go test proxy running at GOPROXY=http://127.0.0.1:40891/mod
2022/11/16 17:25:02 http: TLS handshake error from 127.0.0.1:58580: EOF
2022/11/16 17:25:16 http: TLS handshake error from 127.0.0.1:55612: read tcp 127.0.0.1:41029->127.0.0.1:55612: read: connection reset by peer
2022/11/16 17:25:16 http: TLS handshake error from 127.0.0.1:55610: EOF
2022/11/16 17:25:16 http: TLS handshake error from 127.0.0.1:55652: EOF
2022/11/16 17:25:16 http: TLS handshake error from 127.0.0.1:55674: EOF
2022/11/16 17:25:16 http: TLS handshake error from 127.0.0.1:55708: EOF
2022/11/16 17:25:16 http: TLS handshake error from 127.0.0.1:55712: EOF
...
--- FAIL: TestScript (0.04s)
    --- FAIL: TestScript/mod_replace_gopkgin (13.49s)
        script_test.go:134: 2022-11-16T17:25:04Z
        script_test.go:136: $WORK=/workdir/tmp/cmd-go-test-2735996516/tmpdir123861510/mod_replace_gopkgin3862546341
        script_test.go:154: 
            # Regression test for golang.org/issue/34254:
            # a clone of gopkg.in/[…].vN should be replaceable by
            # a fork hosted at corp.example.com/[…]/vN,
            # even if there is an explicit go.mod file containing the
            # gopkg.in path. (0.000s)
            # Replacing gopkg.in/[…].vN with a repository with a root go.mod file
            # specifying […].vN and a compatible version should succeed, even if
            # the replacement path is not a gopkg.in path. (13.424s)
            > cd 4-to-4
            > go list -m gopkg.in/src-d/go-git.v4
            [stderr]
            go: gopkg.in/src-d/go-git.v4@v4.13.1 requires
            	gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127: unrecognized import path "gopkg.in/check.v1": reading https://gopkg.in/check.v1?go-get=1: 502 Bad Gateway
            	server response: Cannot obtain refs from GitHub: cannot talk to GitHub: Get https://github.com/go-check/check.git/info/refs?service=git-upload-pack: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
        script_test.go:154: FAIL: mod_replace_gopkgin.txt:20: go list -m gopkg.in/src-d/go-git.v4: exit status 1

watchflakes

24 remaining items

gopherbot

gopherbot commented on Mar 3, 2023

@gopherbot
Contributor

Change https://go.dev/cl/473276 mentions this issue: cmd/go: declare net hosts in script tests

modified the milestones: Go1.21, Go1.22 on Aug 8, 2023
modified the milestones: Go1.22, Go1.23 on Feb 6, 2024
modified the milestones: Go1.23, Go1.24 on Apr 29, 2024
dmitshur

dmitshur commented on Nov 23, 2024

@dmitshur
Member

This hasn't happened in a while, and it's just being bumped from release to release. Moving to Backlog. (If someone starts working on this, feel free to move to the corresponding release milestone.)

modified the milestones: Go1.24, Backlog on Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.

    Type

    No type

    Projects

    Status

    Active

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dmitshur@bcmills@gopherbot@seankhliao@joedian

        Issue actions

          cmd/go: remove test dependency on gopkg.in service · Issue #54503 · golang/go