go: cmd/go/internal/modfetch: TestCodeRepo failures due to external repo changes

$ gotip version
go version devel +fe562cebf1 Sun Nov 18 16:13:13 2018 +0000 linux/amd64

To reproduce:

$ cd src/cmd/go/internal/modfetch

$ gotip test -run=TestCodeRepo
--- FAIL: TestCodeRepo (58.16s)
    --- FAIL: TestCodeRepo/gopkg.in_yaml.v2/v2 (3.32s)
        coderepo_test.go:368: info.Version = "v2.2.2-0.20181115110504-51d6538a90f8", want "v2.2.1"
        coderepo_test.go:371: info.Name = "51d6538a90f86fe93ac480b35f37b2be17fef232", want "5420a8b6744d3b0345ab293f6fcba19c978f1183"
        coderepo_test.go:374: info.Short = "51d6538a90f8", want "5420a8b6744d"
        coderepo_test.go:377: info.Time = 2018-11-15 11:05:04 +0000 UTC, want 2018-03-28 19:50:20 +0000 UTC
FAIL
exit status 1
FAIL	cmd/go/internal/modfetch	60.812s

Spotted on the longtest builder.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 1
  • Comments: 30 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Happened again, I sent the patch above to align the expected data for now, waiting for the test to become independent from external repositories.

longtest builders broken again: https://build.golang.org/log/f95a05162e528c34983f8d4604d76a6f427f86e6

--- FAIL: TestCodeRepoVersions (1.80s)
    --- FAIL: TestCodeRepoVersions/parallel (0.00s)
        --- FAIL: TestCodeRepoVersions/parallel/gopkg.in_russross_blackfriday.v2 (1.80s)
            coderepo_test.go:684: Versions(""):
                have [v2.0.0 v2.0.1 v2.1.0-pre.1]
                want [v2.0.0 v2.0.1]
FAIL
FAIL	cmd/go/internal/modfetch	17.284s

@dmitshur, this issue is specifically about TestCodeRepo, so separate issues would probably be good. Ideally, we should resolve these by starting up a test-local server rather than merely moving the tests to vcs-test.golang.org, but that’s a lot of work…

Happened again, see https://build.golang.org/log/8f1046f8a9e1125cfab4e50441e865afc7aafa72

--- FAIL: TestCodeRepo (10.52s)
    --- FAIL: TestCodeRepo/parallel (0.00s)
        --- FAIL: TestCodeRepo/parallel/gopkg.in_yaml.v2/v2 (3.46s)
            coderepo_test.go:443: info.Version = "v2.2.5-0.20191002202810-970885f01c8b", want "v2.2.3"
            coderepo_test.go:446: info.Name = "970885f01c8bc1fecb7ab1c8ce8e7609bda45530", want "bb4e33bf68bf89cad44d386192cbed201f35b241"
            coderepo_test.go:449: info.Short = "970885f01c8b", want "bb4e33bf68bf"
            coderepo_test.go:452: info.Time = 2019-10-02 20:28:10 +0000 UTC, want 2019-09-30 19:09:21 +0000 UTC

Sent https://golang.org/cl/198557

Happened again.

--- FAIL: TestCodeRepo (9.55s)
    --- FAIL: TestCodeRepo/parallel (0.00s)
        --- FAIL: TestCodeRepo/parallel/gopkg.in_yaml.v2/v2 (3.62s)
            coderepo_test.go:443: info.Version = "v2.2.3", want "v2.2.3-0.20190319135612-7b8349ac747c"
            coderepo_test.go:446: info.Name = "bb4e33bf68bf89cad44d386192cbed201f35b241", want "7b8349ac747c6a24702b762d2c4fd9266cf4f1d6"
            coderepo_test.go:449: info.Short = "bb4e33bf68bf", want "7b8349ac747c"
            coderepo_test.go:452: info.Time = 2019-09-30 19:09:21 +0000 UTC, want 2019-03-19 13:56:12 +0000 UTC

From https://build.golang.org/log/b73d1e539a95bac69fec321f90c305f4b69944fe

Why are we running tests against repos that are active and not controlled by us? Seems that we should be hitting repos that we control and are pre-baked.

@bradfitz