x/tools/go/packages: 在Windows上测试结果不稳定

k5ifujac  于 7个月前  发布在  Go
关注(0)|答案(2)|浏览(64)
[https://build.golang.org/log/60aa789811bdedb1697255f1dee30adb917d3f0c](https://build.golang.org/log/60aa789811bdedb1697255f1dee30adb917d3f0c) 
 [https://build.golang.org/log/ede332848726e7af41109fe3ebc7e813e58f7ab8](https://build.golang.org/log/ede332848726e7af41109fe3ebc7e813e58f7ab8) 
 [https://storage.googleapis.com/go-build-log/dc889025/windows-amd64-2016_fed5c8f5.log](https://storage.googleapis.com/go-build-log/dc889025/windows-amd64-2016_fed5c8f5.log)
example:

--- FAIL: TestLoadTypes (0.50s)
--- FAIL: TestLoadTypes/Modules (0.34s)
packages_test.go:523: wrong import graph: got <<>>, want <<* golang.org/fake/a
golang.org/fake/b
golang.org/fake/c
golang.org/fake/a -> golang.org/fake/b
golang.org/fake/a -> golang.org/fake/c
>>
packages_test.go:541: missing package: golang.org/fake/a
packages_test.go:541: missing package: golang.org/fake/b
packages_test.go:541: missing package: golang.org/fake/c
FAIL
FAIL golang.org/x/tools/go/packages 34.826s

r1wp621o

r1wp621o2#

我不确定这是否是相同的问题还是另一个,但我也在Windows trybots上看到了以下测试失败(所有其他trybot都通过):

--- FAIL: TestLoadSyntaxOK (0.65s)
    --- FAIL: TestLoadSyntaxOK/Modules (0.24s)
        packages_test.go:606: wrong import graph: got <<>>, want <<* golang.org/fake/a
              golang.org/fake/b
            * golang.org/fake/c
              golang.org/fake/d
              golang.org/fake/e
              golang.org/fake/f
              golang.org/fake/a -> golang.org/fake/b
              golang.org/fake/b -> golang.org/fake/c
              golang.org/fake/c -> golang.org/fake/d
              golang.org/fake/d -> golang.org/fake/e
              golang.org/fake/e -> golang.org/fake/f
            >>
        packages_test.go:631: missing package: golang.org/fake/a
        packages_test.go:631: missing package: golang.org/fake/b
        packages_test.go:631: missing package: golang.org/fake/c
        packages_test.go:631: missing package: golang.org/fake/d
        packages_test.go:631: missing package: golang.org/fake/e
        packages_test.go:631: missing package: golang.org/fake/f
        packages_test.go:659: a.A: got nil
FAIL
FAIL	golang.org/x/tools/go/packages	37.982s

还有:

panic: runtime error: index out of range [recovered]
	panic: runtime error: index out of range

goroutine 439 [running]:
testing.tRunner.func1(0x12810000)
	C:/workdir/go/src/testing/testing.go:830 +0x30e
panic(0x69a260, 0x90df70)
	C:/workdir/go/src/runtime/panic.go:532 +0x165
golang.org/x/tools/go/packages_test.testParseFileModifyAST(0x12810000, 0x740990, 0x92489c)
	C:/workdir/gopath/src/golang.org/x/tools/go/packages/packages_test.go:810 +0x3d7
golang.org/x/tools/go/packages/packagestest.TestAll.func1(0x12810000)
	C:/workdir/gopath/src/golang.org/x/tools/go/packages/packagestest/export.go:99 +0x51
testing.tRunner(0x12810000, 0x12776140)
	C:/workdir/go/src/testing/testing.go:865 +0x97
created by testing.(*T).Run
	C:/workdir/go/src/testing/testing.go:916 +0x2b2
FAIL	golang.org/x/tools/go/packages	26.424s

来自 CL 160837

相关问题