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

x/tools/go/packages: TestJSON fails on Go 1.10 #28609

Closed
bradfitz opened this issue Nov 6, 2018 · 5 comments

Comments

@bradfitz
Copy link
Member

@bradfitz bradfitz commented Nov 6, 2018

The x/tools tests are broken for Go 1.10.

Please fix or t.Skip if they're not relevant:

https://storage.googleapis.com/go-build-log/1ae73979/linux-amd64_de64fb44.log

--- FAIL: TestJSON (0.17s)
    --- FAIL: TestJSON/GOPATH (0.17s)
    	packages_test.go:1312: wrong JSON: got <<{
    			"ID": "golang.org/fake/a",
    			"Name": "a",
    			"PkgPath": "golang.org/fake/a",
    			"GoFiles": [
    				"a.go"
    			],
    			"CompiledGoFiles": [
    				"a.go"
    			]
    		}
    		{
    			"ID": "golang.org/fake/b",
    			"Name": "b",
    			"PkgPath": "golang.org/fake/b",
    			"GoFiles": [
    				"b.go"
    			],
    			"CompiledGoFiles": [
    				"b.go"
    			],
    			"Imports": {
    				"golang.org/fake/a": "golang.org/fake/a"
    			}
    		}
    		{
    			"ID": "golang.org/fake/d",
    			"Name": "d",
    			"PkgPath": "golang.org/fake/d",
    			"GoFiles": [
    				"d.go"
    			],
    			"CompiledGoFiles": [
    				"d.go"
    			],
    			"Imports": {
    				"golang.org/fake/b": "golang.org/fake/b"
    			}
    		}
    		{
    			"ID": "golang.org/fake/c",
    			"Name": "c",
    			"PkgPath": "golang.org/fake/c",
    			"GoFiles": [
    				"c.go"
    			],
    			"CompiledGoFiles": [
    				"c.go"
    			],
    			"Imports": {
    				"golang.org/fake/b": "golang.org/fake/b"
    			}
    		}
    		>>, want <<{
    			"ID": "golang.org/fake/a",
    			"Name": "a",
    			"PkgPath": "golang.org/fake/a",
    			"GoFiles": [
    				"a.go"
    			],
    			"CompiledGoFiles": [
    				"a.go"
    			]
    		}
    		{
    			"ID": "golang.org/fake/b",
    			"Name": "b",
    			"PkgPath": "golang.org/fake/b",
    			"GoFiles": [
    				"b.go"
    			],
    			"CompiledGoFiles": [
    				"b.go"
    			],
    			"Imports": {
    				"golang.org/fake/a": "golang.org/fake/a"
    			}
    		}
    		{
    			"ID": "golang.org/fake/c",
    			"Name": "c",
    			"PkgPath": "golang.org/fake/c",
    			"GoFiles": [
    				"c.go"
    			],
    			"CompiledGoFiles": [
    				"c.go"
    			],
    			"Imports": {
    				"golang.org/fake/b": "golang.org/fake/b"
    			}
    		}
    		{
    			"ID": "golang.org/fake/d",
    			"Name": "d",
    			"PkgPath": "golang.org/fake/d",
    			"GoFiles": [
    				"d.go"
    			],
    			"CompiledGoFiles": [
    				"d.go"
    			],
    			"Imports": {
    				"golang.org/fake/b": "golang.org/fake/b"
    			}
    		}
    		>>
    	packages_test.go:1351: Package 2 has ID "golang.org/fake/d" want "golang.org/fake/c"
    	packages_test.go:1354: Package "golang.org/fake/d" has Name "d" want "c"
    	packages_test.go:1351: Package 3 has ID "golang.org/fake/c" want "golang.org/fake/d"
    	packages_test.go:1354: Package "golang.org/fake/c" has Name "c" want "d"
FAIL
FAIL	golang.org/x/tools/go/packages	22.059s
@vikramcse

This comment has been minimized.

Copy link

@vikramcse vikramcse commented Nov 6, 2018

@bradfitz I would like to work on this issue

@bradfitz

This comment has been minimized.

Copy link
Member Author

@bradfitz bradfitz commented Nov 6, 2018

@vikramcse, you don't need to ask permission. Just send a fix if you have a fix.

@bradfitz

This comment has been minimized.

Copy link
Member Author

@bradfitz bradfitz commented Nov 7, 2018

This passes sometimes and fails other times.

Best way to reproduce:

$ GOROOT=$HOME/go1.10 go test -short -v -run=JSON -count=20

Probably some map enumeration order thing?

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 8, 2018

Change https://golang.org/cl/148637 mentions this issue: go/packages: skip TestJSON before Go 1.11

gopherbot pushed a commit to golang/tools that referenced this issue Nov 8, 2018
Updates golang/go#28609
Updates golang/go#28676

Change-Id: Id0fbc6cb0ce14aed9b20afcd0488708df33d5a62
Reviewed-on: https://go-review.googlesource.com/c/148637
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 9, 2018

Change https://golang.org/cl/148880 mentions this issue: go/packages: fix flaky TestJSON and reenable it on Go 1.10

@golang golang locked and limited conversation to collaborators Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.