golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.85k stars 17.51k forks source link

x/tools/gopls/internal/cmd: TestFix failures #64765

Closed gopherbot closed 8 months ago

gopherbot commented 9 months ago
#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"

Issue created automatically to collect these failures.

Example (log):

2023/12/15 22:30:48 New session
    create_session=1
Log: Loading packages...
2023/12/15 22:30:48 go info for /workdir/tmp/fake4193955195
(go dir /workdir/tmp/fake4193955195)
(go version go version go1.21.5 linux/ppc64le)
(valid build configuration = true)
(build flags: [])
(selected go env: [GO111MODULE=, GOCACHE=/workdir/gocache, GOFLAGS=, GOMODCACHE=/workdir/gopath/pkg/mod, GOPATH=/workdir/gopath, GOPRIVATE=, GOROOT=/workdir/go, GOWORK=])

...
--- FAIL: TestFix (1.14s)
    integration_test.go:963: fix: got <<>>, want <<package a
        type T int
        func f() (int, string) { return 0, "" }

        >>
        stderr:
        Log: Loading packages...
        Info: Finished loading packages.
        Log: Running...
        Info: completed

watchflakes

gopherbot commented 9 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2023-12-15 21:59 linux-ppc64le-buildlet tools@4d2b6e1d go@bbab863a x/tools/gopls/internal/cmd.TestFix (log) 2023/12/15 22:30:48 New session create_session=1 Log: Loading packages... 2023/12/15 22:30:48 go info for /workdir/tmp/fake4193955195 (go dir /workdir/tmp/fake4193955195) (go version go version go1.21.5 linux/ppc64le) (valid build configuration = true) (build flags: []) (selected go env: [GO111MODULE=, GOCACHE=/workdir/gocache, GOFLAGS=, GOMODCACHE=/workdir/gopath/pkg/mod, GOPATH=/workdir/gopath, GOPRIVATE=, GOROOT=/workdir/go, GOWORK=]) ... --- FAIL: TestFix (1.14s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

findleyr commented 9 months ago

May be related to my change to diagnostic logic. Let's see.

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2023-12-18 20:56 linux-ppc64-sid-power10 tools@ee47fd47 go@52dbffea x/tools/gopls/internal/cmd.TestFix (log) 2023/12/19 14:57:06 New session create_session=1 Log: Loading packages... 2023/12/19 14:57:06 go info for /workdir/tmp/fake2287754878 (go dir /workdir/tmp/fake2287754878) (go version go version devel 52dbffeac86863e1e0c9455b5b216ec50c828946 linux/ppc64) (valid build configuration = true) (build flags: []) 2023/12/19 14:57:06 go/packages.Load #1 ... --- FAIL: TestFix (1.13s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2023-12-19 22:22 netbsd-arm64-bsiegert tools@160631f7 go@8cb86b5f x/tools/gopls/internal/cmd.TestFix (log) 2023/12/20 00:09:05 New session create_session=1 Log: Loading packages... 2023/12/20 00:09:05 go info for /var/gobuilder/buildlet/tmp/fake534038479 (go dir /var/gobuilder/buildlet/tmp/fake534038479) (go version go version go1.20.12 netbsd/arm64) (valid build configuration = true) (build flags: []) 2023/12/20 00:09:05 go/packages.Load #1 ... --- FAIL: TestFix (6.52s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2023-12-26 17:53 freebsd-arm64-dmgk tools@025ebe62 go@bbab863a x/tools/gopls/internal/cmd.TestFix (log) 2023/12/26 18:48:59 New session create_session=1 Log: Loading packages... 2023/12/26 18:48:59 go info for /tmp/workdir-host-freebsd-arm64-dmgk/tmp/fake2191482282 (go dir /tmp/workdir-host-freebsd-arm64-dmgk/tmp/fake2191482282) (go version go version go1.21.5 freebsd/arm64) (valid build configuration = true) (build flags: []) 2023/12/26 18:48:59 go/packages.Load #1 ... --- FAIL: TestFix (2.27s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2023-12-31 00:29 windows-amd64-race tools@baf6fd25 go@b25f5558 x/tools/gopls/internal/cmd.TestFix (log) 2023/12/31 00:37:06 New session create_session=1 Log: Loading packages... 2023/12/31 00:37:06 go info for C:\Users\gopher\AppData\Local\Temp\1\fake2524320266 (go dir C:\Users\gopher\AppData\Local\Temp\1\fake2524320266) (go version go version devel b25f5558c69140deb652337afaab5c1186cd0ff1 windows/amd64) (valid build configuration = true) (build flags: []) 2023/12/31 00:37:06 go/packages.Load #1 ... --- FAIL: TestFix (18.20s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed 2023/12/31 00:37:36 background imports cache refresh starting 2023/12/31 00:37:37 background refresh finished after 375.0014ms

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-03 10:09 linux-arm-aws tools@5e6f314f go@8cb86b5f x/tools/gopls/internal/cmd.TestFix (log) 2024/01/03 10:19:18 New session create_session=1 Log: Loading packages... 2024/01/03 10:19:18 go info for /workdir/tmp/fake1663239641 (go dir /workdir/tmp/fake1663239641) (go version go version go1.20.12 linux/arm) (valid build configuration = true) (build flags: []) 2024/01/03 10:19:18 go/packages.Load #1 ... --- FAIL: TestFix (1.38s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-03 12:29 windows-amd64-longtest tools@a863a4fc go@15dcdeb5 x/tools/gopls/internal/cmd.TestFix (log) 2024/01/04 17:56:15 New session create_session=1 Log: Loading packages... 2024/01/04 17:56:15 go info for C:\Users\gopher\AppData\Local\Temp\1\fake3684954021 (go dir C:\Users\gopher\AppData\Local\Temp\1\fake3684954021) (go version go version devel 15dcdeb5aacb4503e3d053f198bd4669d5cec2aa windows/amd64) (valid build configuration = true) (build flags: []) 2024/01/04 17:56:15 go/packages.Load #1 ... --- FAIL: TestFix (9.09s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed 2024/01/04 17:56:45 background imports cache refresh starting 2024/01/04 17:56:46 background refresh finished after 120.1155ms

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-03 12:29 linux-amd64-wsl tools@a863a4fc go@9e4abed3 x/tools/gopls/internal/cmd.TestFix (log) 2024/01/05 10:43:04 New session create_session=1 Log: Loading packages... 2024/01/05 10:43:04 go info for /tmp/workdir-host-linux-amd64-wsl/tmp/fake2976449572 (go dir /tmp/workdir-host-linux-amd64-wsl/tmp/fake2976449572) (go version go version go1.20.12 linux/amd64) (valid build configuration = true) (build flags: []) 2024/01/05 10:43:04 go/packages.Load #1 ... --- FAIL: TestFix (1.69s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-05 14:41 netbsd-386-9_3 tools@2e53332c go@d2cb1401 x/tools/gopls/internal/cmd.TestFix (log) 2024/01/05 14:44:41 New session create_session=1 Log: Loading packages... 2024/01/05 14:44:41 go info for /tmp/workdir/tmp/fake1026785101 (view type GoModView) (root dir /tmp/workdir/tmp/fake1026785101) (go version go version go1.21.5 netbsd/386) (build flags: []) (go env: {GOOS:netbsd GOARCH:386 GOCACHE:/tmp/workdir/gocache GOMODCACHE:/tmp/workdir/gopath/pkg/mod GOPATH:/tmp/workdir/gopath GOPRIVATE: GOFLAGS: GO111MODULE: GoVersion:21 GoVersionOutput:go version go1.21.5 netbsd/386 GOWORK: GOPACKAGESDRIVER:}) ... --- FAIL: TestFix (2.18s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-08 23:16 dragonfly-amd64-622 tools@c95fa0ff go@821f9410 x/tools/gopls/internal/cmd.TestFix (log) 2024/01/09 09:07:14 New session create_session=1 Log: Loading packages... 2024/01/09 09:07:14 go info for /tmp/workdir/tmp/fake1338282469 (view type GoModView) (root dir /tmp/workdir/tmp/fake1338282469) (go version go version devel 821f94103b2980758cdb21ac6ae834ef0a07235a dragonfly/amd64) (build flags: []) (go env: {GOOS:dragonfly GOARCH:amd64 GOCACHE:/tmp/workdir/gocache GOMODCACHE:/tmp/workdir/gopath/pkg/mod GOPATH:/tmp/workdir/gopath GOPRIVATE: GOFLAGS: GO111MODULE: GoVersion:22 GoVersionOutput:go version devel 821f94103b2980758cdb21ac6ae834ef0a07235a dragonfly/amd64 GOWORK: GOPACKAGESDRIVER:}) ... --- FAIL: TestFix (1.99s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

findleyr commented 8 months ago

Looked into this briefly, but have to go for the day. Found the bug, it's a real race:

Like this: we open the file, and then there's a race between the fast-path diagnostics (which don't include analysis) and the result of diagnoseFiles, which does include analysis. The type error analyzer is run during analysis.

If we just awaited the diagnostics, similarly to how we await them in regtests, there would be no race and we could delete the diagnoseFiles backdoor.

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-12 22:43 linux-ppc64-sid-buildlet tools@9164f2ae go@7abeefd2 x/tools/gopls/internal/cmd.TestFix (log) 2024/01/13 11:29:58 New session create_session=1 Log: Loading packages... 2024/01/13 11:29:58 go info for /workdir/tmp/fake307958064 (view type GoModView) (root dir /workdir/tmp/fake307958064) (go version go version devel 7abeefd2b1a03932891e581f1f90656ffebebce4 linux/ppc64) (build flags: []) (go env: {GOOS:linux GOARCH:ppc64 GOCACHE:/workdir/gocache GOMODCACHE:/workdir/gopath/pkg/mod GOPATH:/workdir/gopath GOPRIVATE: GOFLAGS: GO111MODULE: GoVersion:22 GoVersionOutput:go version devel 7abeefd2b1a03932891e581f1f90656ffebebce4 linux/ppc64 GOWORK: GOPACKAGESDRIVER:}) ... --- FAIL: TestFix (1.42s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 8 months ago

Change https://go.dev/cl/556475 mentions this issue: gopls/internal/server: simplify DiagnoseFiles to avoiding races

gopherbot commented 8 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-17 18:13 windows-arm64-11 tools@d5171129 go@a95136a8 x/tools/gopls/internal/cmd.TestFix (log) 2024/01/17 18:44:10 New session create_session=1 Log: Loading packages... 2024/01/17 18:44:10 go info for C:\Users\gopher\AppData\Local\Temp\fake3502209795 (view type GoModView) (root dir C:\Users\gopher\AppData\Local\Temp\fake3502209795) (go version go version go1.20.13 windows/arm64) (build flags: []) (go env: {GOOS:windows GOARCH:arm64 GOCACHE:C:\workdir\gocache GOMODCACHE:C:\workdir\gopath\pkg\mod GOPATH:C:\workdir\gopath GOPRIVATE: GOFLAGS: GO111MODULE: GoVersion:20 GoVersionOutput:go version go1.20.13 windows/arm64 GOWORK: GOPACKAGESDRIVER:}) ... --- FAIL: TestFix (7.33s) integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed

watchflakes

gopherbot commented 7 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-12 21:33 x_tools-go1.21-windows-386 tools@54cf5bc0 release-branch.go1.21@2540b143 x/tools/gopls/internal/cmd.TestFix (log) === RUN TestFix === PAUSE TestFix === CONT TestFix integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed --- FAIL: TestFix (14.06s)

watchflakes

gopherbot commented 7 months ago

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && test == "TestFix"
2024-01-08 18:41 x_tools-go1.20-darwin-amd64_14 tools@25a0e9d3 release-branch.go1.20@5c38c049 x/tools/gopls/internal/cmd.TestFix (log) === RUN TestFix === PAUSE TestFix === CONT TestFix integration_test.go:963: fix: got <<>>, want <> stderr: Log: Loading packages... Info: Finished loading packages. Log: Running... Info: completed --- FAIL: TestFix (2.61s)

watchflakes