Skip to content

x/tools/gopls: tests flake due to race between child process exit and tmpdir removal [windows] #80029

Description

@gopherbot
#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/cmd" && output ~ `cleanup: unlinkat C:.*: The process cannot access the file because it is being used by another process.`

See also #68087, which seems to be the same bug on openbsd, and a fix for one might kill two stones with one bird.

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestMCPCommandHTTP
2026/06/15 14:41:43 Info:2026/06/15 14:41:43 Created View (#1)
	directory=C:\b\s\w\ir\x\t\TestMCPCommandHTTP3166242540\001
	view_type="GoMod"
	root_dir="file:///C:/b/s/w/ir/x/t/TestMCPCommandHTTP3166242540/001"
	go_version="go version go1.27-devel_0ed83956d30747aaddce636adc87bcd04e2c9cd1 windows/amd64"
	build_flags=[]
	env={GOOS:windows GOARCH:amd64 GOCACHE:C:\b\s\w\ir\x\w\gocache GOMODCACHE:C:\b\s\w\ir\x\w\gopath\pkg\mod GOPATH:C:\b\s\w\ir\x\w\gopath GOPRIVATE: GOFLAGS: GO111MODULE: GOTOOLCHAIN:local GOROOT:C:\b\s\w\ir\x\w\goroot GoVersion:27 GoVersionOutput:go version go1.27-devel_0ed83956d30747aaddce636adc87bcd04e2c9cd1 windows/amd64
 ExplicitGOWORK: EffectiveGOPACKAGESDRIVER:}
	env_overlay=[]
2026/06/15 14:41:45 Info:2026/06/15 14:41:45 go/packages.Load #1
	view_id="1"
	snapshot=0
	directory=C:\b\s\w\ir\x\t\TestMCPCommandHTTP3166242540\001
	query=[C:\b\s\w\ir\x\t\TestMCPCommandHTTP3166242540\001\... builtin]
	packages=3
	duration=1.72738s
2026/06/15 14:41:45 Gopls MCP server: starting up on http
2026/06/15 14:41:45 mcp http server listening
    testing.go:1617: TempDir RemoveAll cleanup: unlinkat C:\b\s\w\ir\x\t\TestMCPCommandHTTP3166242540\001: The process cannot access the file because it is being used by another process.
--- FAIL: TestMCPCommandHTTP (5.28s)

watchflakes

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutomationIssues created by gopherbot or watchflakes automation.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Active

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions