#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/test/integration/codelens" && test == "TestUpgradeCodelens_Workspace/Upgrade_transitive_dependencies/default"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestUpgradeCodelens_Workspace/Upgrade_transitive_dependencies/default
goroutine profile: total 12
1 @ 0x9b9fb1 0x9f8a9d 0xb96db1 0xb96be5 0xb93a0b 0x150ec30 0x150e883 0xae184b 0xa02541
#   0xb96db0    runtime/pprof.writeRuntimeProfile+0xb0                      C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/pprof/pprof.go:796
#   0xb96be4    runtime/pprof.writeGoroutine+0x44                       C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/pprof/pprof.go:755
#   0xb93a0a    runtime/pprof.(*Profile).WriteTo+0x14a                      C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/pprof/pprof.go:377
#   0x150ec2f   golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1.1+0x6f   C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/test/integration/runner.go:197
#   0x150e882   golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1+0x962    C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/test/integration/runner.go:239
#   0xae184a    testing.tRunner+0xca                                C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/testing/testing.go:1792

...
#   0x11c60c9   golang.org/x/tools/internal/imports.(*ProcessEnv).GetResolver+0x309     C:/b/s/w/ir/x/w/targetrepo3829237906/internal/imports/fix.go:1034
#   0x12c3595   golang.org/x/tools/gopls/internal/cache.(*importsState).refreshProcessEnv+0xd5  C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/cache/imports.go:300
#   0x12c1fe3   golang.org/x/tools/gopls/internal/cache.(*refreshTimer).schedule.func1+0xc3 C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/cache/imports.go:72

1 @ 0x9f9d4e 0x9fe167 0xda5fb4 0xa02541
#   0x9fe166    time.Sleep+0x166                    C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/time.go:338
#   0xda5fb3    golang.org/x/tools/gopls/internal/filecache.gc+0x133    C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/filecache/filecache.go:457

    runner.go:198: closing the sandbox: error(s) cleaning sandbox: cleaning modcache: <nil>; removing files: remove C:\b\s\w\ir\x\t\gopls-test-1799931562\TestUpgradeCodelens_Workspace\Upgrade_transitive_dependencies\default\gopath\pkg\mod\cache\download\golang.org\x\hello\@v: The directory is not empty.
--- FAIL: TestUpgradeCodelens_Workspace/Upgrade_transitive_dependencies/default (37.98s)

watchflakes

Comment From: gopherbot

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/test/integration/codelens" && test == "TestUpgradeCodelens_Workspace/Upgrade_transitive_dependencies/default"
2025-05-14 19:41 x_tools-go1.23-windows-amd64-longtest tools@3c52d1f5 release-branch.go1.23@f77084d1 x/tools/gopls/internal/test/integration/codelens.TestUpgradeCodelens_Workspace/Upgrade_transitive_dependencies/default (log) === RUN TestUpgradeCodelens_Workspace/Upgrade_transitive_dependencies/default goroutine profile: total 12 1 @ 0x9b9fb1 0x9f8a9d 0xb96db1 0xb96be5 0xb93a0b 0x150ec30 0x150e883 0xae184b 0xa02541 # 0xb96db0 runtime/pprof.writeRuntimeProfile+0xb0 C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/pprof/pprof.go:796 # 0xb96be4 runtime/pprof.writeGoroutine+0x44 C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/pprof/pprof.go:755 # 0xb93a0a runtime/pprof.(*Profile).WriteTo+0x14a C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/pprof/pprof.go:377 # 0x150ec2f golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1.1+0x6f C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/test/integration/runner.go:197 # 0x150e882 golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1+0x962 C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/test/integration/runner.go:239 # 0xae184a testing.tRunner+0xca C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/testing/testing.go:1792 ... # 0x11c60c9 golang.org/x/tools/internal/imports.(*ProcessEnv).GetResolver+0x309 C:/b/s/w/ir/x/w/targetrepo3829237906/internal/imports/fix.go:1034 # 0x12c3595 golang.org/x/tools/gopls/internal/cache.(*importsState).refreshProcessEnv+0xd5 C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/cache/imports.go:300 # 0x12c1fe3 golang.org/x/tools/gopls/internal/cache.(*refreshTimer).schedule.func1+0xc3 C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/cache/imports.go:72 1 @ 0x9f9d4e 0x9fe167 0xda5fb4 0xa02541 # 0x9fe166 time.Sleep+0x166 C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/time.go:338 # 0xda5fb3 golang.org/x/tools/gopls/internal/filecache.gc+0x133 C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/filecache/filecache.go:457 runner.go:198: closing the sandbox: error(s) cleaning sandbox: cleaning modcache: ; removing files: remove C:\b\s\w\ir\x\t\gopls-test-1799931562\TestUpgradeCodelens_Workspace\Upgrade_transitive_dependencies\default\gopath\pkg\mod\cache\download\golang.org\x\hello\@v: The directory is not empty. --- FAIL: TestUpgradeCodelens_Workspace/Upgrade_transitive_dependencies/default (37.98s)

watchflakes

Comment From: adonovan

The stacks show that gopls is running imports.ProcessEnv.GetResolver, which is stuck trying to read the output of the go list -m -e -json ... subprocess.

cc: @pjweinb for gopls/imports, @matloob @samthanawalla for go list

1 @ 0x9f68fe 0x9e36ee 0x9fddf8 0xa247eb 0xa1e38d 0xa1e380 0xa4ebf5 0xa5b00f 0xa5b00a 0xac62f8 0xa3ec71 0xa5b7ef 0xa5b7af 0xa5b729 0xa3ebbd 0xb2a954 0xb2a940 0xb2b60c 0xa02541
#   0x9fddf7    syscall.Syscall6+0x37               C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/syscall_windows.go:463
#   0xa247ea    syscall.readFile+0x8a               C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/syscall/zsyscall_windows.go:1020
#   0xa1e38c    syscall.ReadFile+0x2c               C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/syscall/syscall_windows.go:453
#   0xa1e37f    syscall.Read+0x1f               C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/syscall/syscall_windows.go:432
#   0xa4ebf4    internal/poll.(*FD).Read+0x1b4          C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/internal/poll/fd_windows.go:424
#   0xa5b00e    os.(*File).read+0x4e                C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file_posix.go:29
#   0xa5b009    os.(*File).Read+0x49                C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file.go:124
#   0xac62f7    bytes.(*Buffer).ReadFrom+0x97           C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/bytes/buffer.go:211
#   0xa3ec70    io.copyBuffer+0x150             C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:415
#   0xa5b7ee    io.Copy+0x4e                    C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:388
#   0xa5b7ae    os.genericWriteTo+0xe               C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file.go:275
#   0xa5b728    os.(*File).WriteTo+0x48             C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file.go:253
#   0xa3ebbc    io.copyBuffer+0x9c              C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:411
#   0xb2a953    io.Copy+0x33                    C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:388
#   0xb2a93f    os/exec.(*Cmd).writerDescriptor.func1+0x1f  C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/exec/exec.go:596
#   0xb2b60b    os/exec.(*Cmd).Start.func2+0x2b         C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/exec/exec.go:749

1 @ 0x9f68fe 0x9e36ee 0x9fddf8 0xa247eb 0xa1e38d 0xa1e380 0xa4ebf5 0xa5b00f 0xa5b00a 0xac62f8 0xa3ec71 0xa5b7ef 0xa5b7af 0xa5b729 0xa3ebbd 0xd25ac5 0xd25aa8 0xa02541
#   0x9fddf7    syscall.Syscall6+0x37                       C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/runtime/syscall_windows.go:463
#   0xa247ea    syscall.readFile+0x8a                       C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/syscall/zsyscall_windows.go:1020
#   0xa1e38c    syscall.ReadFile+0x2c                       C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/syscall/syscall_windows.go:453
#   0xa1e37f    syscall.Read+0x1f                       C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/syscall/syscall_windows.go:432
#   0xa4ebf4    internal/poll.(*FD).Read+0x1b4                  C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/internal/poll/fd_windows.go:424
#   0xa5b00e    os.(*File).read+0x4e                        C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file_posix.go:29
#   0xa5b009    os.(*File).Read+0x49                        C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file.go:124
#   0xac62f7    bytes.(*Buffer).ReadFrom+0x97                   C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/bytes/buffer.go:211
#   0xa3ec70    io.copyBuffer+0x150                     C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:415
#   0xa5b7ee    io.Copy+0x4e                            C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:388
#   0xa5b7ae    os.genericWriteTo+0xe                       C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file.go:275
#   0xa5b728    os.(*File).WriteTo+0x48                     C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/os/file.go:253
#   0xa3ebbc    io.copyBuffer+0x9c                      C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:411
#   0xd25ac4    io.Copy+0x44                            C:/b/s/w/ir/x/w/gopath/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.windows-amd64/src/io/io.go:388
#   0xd25aa7    golang.org/x/tools/internal/gocommand.runCmdContext.func1+0x27  C:/b/s/w/ir/x/w/targetrepo3829237906/internal/gocommand/invoke.go:322

1 @ 0x9f9d4e 0x9d8e57 0xd251f6 0xd24b9d 0xd23baf 0xd2347f 0xd23090 0xd22806 0x11c67af 0x11cece5 0x11cdd39 0x11c60ca 0x12c3596 0x12c1fe4 0xa02541
#   0xd251f5    golang.org/x/tools/internal/gocommand.runCmdContext+0x475           C:/b/s/w/ir/x/w/targetrepo3829237906/internal/gocommand/invoke.go:387
#   0xd24b9c    golang.org/x/tools/internal/gocommand.(*Invocation).run+0xdfc           C:/b/s/w/ir/x/w/targetrepo3829237906/internal/gocommand/invoke.go:285
#   0xd23bae    golang.org/x/tools/internal/gocommand.(*Invocation).runWithFriendlyError+0x4e   C:/b/s/w/ir/x/w/targetrepo3829237906/internal/gocommand/invoke.go:187
#   0xd2347e    golang.org/x/tools/internal/gocommand.(*Runner).runConcurrent+0x15e     C:/b/s/w/ir/x/w/targetrepo3829237906/internal/gocommand/invoke.go:124
#   0xd2308f    golang.org/x/tools/internal/gocommand.(*Runner).RunRaw+0x36f            C:/b/s/w/ir/x/w/targetrepo3829237906/internal/gocommand/invoke.go:98
#   0xd22805    golang.org/x/tools/internal/gocommand.(*Runner).Run+0x325           C:/b/s/w/ir/x/w/targetrepo3829237906/internal/gocommand/invoke.go:74
#   0x11c67ae   golang.org/x/tools/internal/imports.(*ProcessEnv).invokeGo+0x30e        C:/b/s/w/ir/x/w/targetrepo3829237906/internal/imports/fix.go:1098
#   0x11cece4   golang.org/x/tools/internal/imports.(*ModuleResolver).initAllMods+0xa4      C:/b/s/w/ir/x/w/targetrepo3829237906/internal/imports/mod.go:262
#   0x11cdd38   golang.org/x/tools/internal/imports.newModuleResolver+0xa18         C:/b/s/w/ir/x/w/targetrepo3829237906/internal/imports/mod.go:159
#   0x11c60c9   golang.org/x/tools/internal/imports.(*ProcessEnv).GetResolver+0x309     C:/b/s/w/ir/x/w/targetrepo3829237906/internal/imports/fix.go:1034
#   0x12c3595   golang.org/x/tools/gopls/internal/cache.(*importsState).refreshProcessEnv+0xd5  C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/cache/imports.go:300
#   0x12c1fe3   golang.org/x/tools/gopls/internal/cache.(*refreshTimer).schedule.func1+0xc3 C:/b/s/w/ir/x/w/targetrepo3829237906/gopls/internal/cache/imports.go:72

    runner.go:198: closing the sandbox: error(s) cleaning sandbox: cleaning modcache: <nil>; removing files: remove C:\b\s\w\ir\x\t\gopls-test-1799931562\TestUpgradeCodelens_Workspace\Upgrade_transitive_dependencies\default\gopath\pkg\mod\cache\download\golang.org\x\hello\@v: The directory is not empty.
FAIL
FAIL    golang.org/x/tools/gopls/internal/test/integration/codelens 129.978s

Comment From: pjweinb

Same comment as in 73734: init() should check that the Go command is available before trying to invoke it, and if not, perhaps look in the environment.

Comment From: adonovan

Same comment as in 73734: init() should check that the Go command is available before trying to invoke it, and if not, perhaps look in the environment.

In this issue, the go command clearly is available, since we executed it and it got stuck (or slow). ;-) So I don't think that fix would help here. Our long term plan may be to remove go list from the goimports equation, but I'm more worried about why the go command gets stuck (or slow) for any reason.