Skip to content

cmd/go, x/tools: many tests are broken with go1.19.10 #60650

@findleyr

Description

@findleyr

Many tests, for example x/tools/go/packages, are broken with Go 1.19.10.

Here's an example trybot failure:
https://storage.googleapis.com/go-build-log/3ba9c890/linux-amd64_b61d03c6.log

And here's the failure for go/packages, which may be illustrative:

> go1.19.10 test ./go/packages
--- FAIL: TestMultiplePackageVersionsIssue36188 (0.00s)
    --- FAIL: TestMultiplePackageVersionsIssue36188/GOPATH (0.13s)
        packages_test.go:2199: err: exit status 1: stderr: go build golang.org/fake/b: golang.org/fake/a/a.go:1:19: import "golang.org/fake/b" is a program, not an importable package
            
    --- FAIL: TestMultiplePackageVersionsIssue36188/Modules (0.12s)
        packages_test.go:2199: err: exit status 1: stderr: go build golang.org/fake/b: a/a.go:1:19: import "golang.org/fake/b" is a program, not an importable package
            
--- FAIL: TestReturnErrorForUnexpectedDirectoryLayout (0.00s)
    --- FAIL: TestReturnErrorForUnexpectedDirectoryLayout/Modules (0.10s)
        packages_test.go:1716: want error message: unexpected directory layout, got: err: exit status 1: stderr: go build b: a.go:1:19: package b is not in GOROOT (/usr/local/google/home/rfindley/sdk/go1.19.10/src/b)
--- FAIL: TestInvalidPackageName (0.00s)
    --- FAIL: TestInvalidPackageName/GOPATH (0.06s)
        packages_test.go:2735: err: exit status 1: stderr: go build golang.org/fake: golang.org/fake/main.go:1:9: expected 'IDENT', found 'default'
            
    --- FAIL: TestInvalidPackageName/Modules (0.14s)
        packages_test.go:2735: err: exit status 1: stderr: go build golang.org/fake: main.go:1:9: expected 'IDENT', found 'default'
            
--- FAIL: TestMissingDependency (0.00s)
    --- FAIL: TestMissingDependency/GOPATH (0.10s)
        packages_test.go:1732: err: exit status 1: stderr: go build this/package/doesnt/exist: golang.org/fake/a/a.go:1:19: cannot find package "this/package/doesnt/exist" in any of:
            	/usr/local/google/home/rfindley/sdk/go1.19.10/src/this/package/doesnt/exist (from $GOROOT)
            	/tmp/TestMissingDependency_GOPATH2093183701/fake/src/this/package/doesnt/exist (from $GOPATH)
            
    --- FAIL: TestMissingDependency/Modules (0.19s)
        packages_test.go:1732: err: exit status 1: stderr: go build this/package/doesnt/exist: a/a.go:1:19: package this/package/doesnt/exist is not in GOROOT (/usr/local/google/home/rfindley/sdk/go1.19.10/src/this/package/doesnt/exist)
            
--- FAIL: TestInvalidFilesBeforeOverlay (0.00s)
    --- FAIL: TestInvalidFilesBeforeOverlay/GOPATH (0.06s)
        --- FAIL: TestInvalidFilesBeforeOverlay/GOPATH/no_overlay (0.06s)
            overlay_test.go:739: err: exit status 1: stderr: go build golang.org/fake/d: golang.org/fake/d/d.go:1:1: expected 'package', found 'EOF'
                go build golang.org/fake: golang.org/fake/main.go:1:1: expected 'package', found 'EOF'
                
    --- FAIL: TestInvalidFilesBeforeOverlay/Modules (0.08s)
        --- FAIL: TestInvalidFilesBeforeOverlay/Modules/no_overlay (0.04s)
            overlay_test.go:739: err: exit status 1: stderr: go build golang.org/fake: main.go:1:1: expected 'package', found 'EOF'
                go build golang.org/fake/d: d/d.go:1:1: expected 'package', found 'EOF'
                
--- FAIL: TestInvalidFilesBeforeOverlayContains (0.00s)
    --- FAIL: TestInvalidFilesBeforeOverlayContains/Modules (3.40s)
        --- FAIL: TestInvalidFilesBeforeOverlayContains/Modules/test_variant (1.11s)
            overlay_test.go:825: expected package ID "golang.org/fake/d [golang.org/fake/d.test]", got "command-line-arguments [command-line-arguments.test]"
        --- FAIL: TestInvalidFilesBeforeOverlayContains/Modules/second_file (0.20s)
            overlay_test.go:825: expected package ID "golang.org/fake/d", got "command-line-arguments"
        --- FAIL: TestInvalidFilesBeforeOverlayContains/Modules/main (1.16s)
            overlay_test.go:825: expected package ID "golang.org/fake", got "command-line-arguments"
        --- FAIL: TestInvalidFilesBeforeOverlayContains/Modules/xtest (0.91s)
            overlay_test.go:825: expected package ID "golang.org/fake/d_test [golang.org/fake/d.test]", got "command-line-arguments_test [command-line-arguments.test]"
    --- FAIL: TestInvalidFilesBeforeOverlayContains/GOPATH (3.79s)
        --- FAIL: TestInvalidFilesBeforeOverlayContains/GOPATH/test_variant (1.29s)
            overlay_test.go:825: expected package ID "golang.org/fake/d [golang.org/fake/d.test]", got "command-line-arguments [command-line-arguments.test]"
        --- FAIL: TestInvalidFilesBeforeOverlayContains/GOPATH/second_file (0.24s)
            overlay_test.go:825: expected package ID "golang.org/fake/d", got "command-line-arguments"
        --- FAIL: TestInvalidFilesBeforeOverlayContains/GOPATH/main (1.26s)
            overlay_test.go:825: expected package ID "golang.org/fake", got "command-line-arguments"
        --- FAIL: TestInvalidFilesBeforeOverlayContains/GOPATH/xtest (1.00s)
            overlay_test.go:825: expected package ID "golang.org/fake/d_test [golang.org/fake/d.test]", got "command-line-arguments_test [command-line-arguments.test]"

Given the amount of tests that fail, it seems likely that this failure mode is user-facing.

CC @bcmills @matloob @rsc

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions