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

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestNewDepWithUnusedDep/default/default
goroutine profile: total 8
1 @ 0x4345d1 0x46b6fd 0x5d4f91 0x5d4dc5 0x5d1866 0xe25870 0xe254e2 0x531d5f 0x471e41
#   0x46b6fc    runtime/pprof.runtime_goroutineProfileWithLabels+0x1c               /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mprof.go:844
#   0x5d4f90    runtime/pprof.writeRuntimeProfile+0xb0                      /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:734
#   0x5d4dc4    runtime/pprof.writeGoroutine+0x44                       /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:694
#   0x5d1865    runtime/pprof.(*Profile).WriteTo+0x145                      /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:329
#   0xe2586f    golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1.1+0x6f   /home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:198
#   0xe254e1    golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1+0xf41    /home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:252
#   0x531d5e    testing.tRunner+0xfe                                /home/swarming/.swarming/w/ir/x/w/goroot/src/testing/testing.go:1595
...
#   0x46e614    syscall.syscall6+0x34                       /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/sys_openbsd3.go:46
#   0x483804    syscall.wait4+0x44                      /home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/zsyscall_openbsd_amd64.go:43
#   0x480d04    syscall.Wait4+0x24                      /home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/syscall_bsd.go:144
#   0x4b420c    os.(*Process).wait+0x6c                     /home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec_unix.go:43
#   0x577b84    os.(*Process).Wait+0x44                     /home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec.go:134
#   0x577b7c    os/exec.(*Cmd).Wait+0x3c                    /home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec/exec.go:890
#   0x6f0884    golang.org/x/tools/internal/gocommand.runCmdContext.func4+0x24  /home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/internal/gocommand/invoke.go:382

    runner.go:199: closing the sandbox: error(s) cleaning sandbox: cleaning modcache: <nil>; removing files: unlinkat /home/swarming/.swarming/w/ir/x/t/gopls-test-3845998539/TestNewDepWithUnusedDep/default/default: directory not empty
--- FAIL: TestNewDepWithUnusedDep/default/default (32.85s)

watchflakes

Comment From: gopherbot

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/test/integration/modfile" && test == "TestNewDepWithUnusedDep/default/default"
2024-06-06 18:30 x_tools-go1.21-openbsd-amd64 tools@5e0f1d8d release-branch.go1.21@48103d97 x/tools/gopls/internal/test/integration/modfile.TestNewDepWithUnusedDep/default/default (log) === RUN TestNewDepWithUnusedDep/default/default goroutine profile: total 8 1 @ 0x4345d1 0x46b6fd 0x5d4f91 0x5d4dc5 0x5d1866 0xe25870 0xe254e2 0x531d5f 0x471e41 # 0x46b6fc runtime/pprof.runtime_goroutineProfileWithLabels+0x1c /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mprof.go:844 # 0x5d4f90 runtime/pprof.writeRuntimeProfile+0xb0 /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:734 # 0x5d4dc4 runtime/pprof.writeGoroutine+0x44 /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:694 # 0x5d1865 runtime/pprof.(*Profile).WriteTo+0x145 /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:329 # 0xe2586f golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1.1+0x6f /home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:198 # 0xe254e1 golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1+0xf41 /home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:252 # 0x531d5e testing.tRunner+0xfe /home/swarming/.swarming/w/ir/x/w/goroot/src/testing/testing.go:1595 ... # 0x46e614 syscall.syscall6+0x34 /home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/sys_openbsd3.go:46 # 0x483804 syscall.wait4+0x44 /home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/zsyscall_openbsd_amd64.go:43 # 0x480d04 syscall.Wait4+0x24 /home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/syscall_bsd.go:144 # 0x4b420c os.(*Process).wait+0x6c /home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec_unix.go:43 # 0x577b84 os.(*Process).Wait+0x44 /home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec.go:134 # 0x577b7c os/exec.(*Cmd).Wait+0x3c /home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec/exec.go:890 # 0x6f0884 golang.org/x/tools/internal/gocommand.runCmdContext.func4+0x24 /home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/internal/gocommand/invoke.go:382 runner.go:199: closing the sandbox: error(s) cleaning sandbox: cleaning modcache: ; removing files: unlinkat /home/swarming/.swarming/w/ir/x/t/gopls-test-3845998539/TestNewDepWithUnusedDep/default/default: directory not empty --- FAIL: TestNewDepWithUnusedDep/default/default (32.85s)

watchflakes

Comment From: findleyr

This flake demonstrates that with https://go.dev/cl/590377, I exacerbated an existing problem by always scheduling a module cache refresh when views are created.

As a result, it is more likely that timers run after view shutdown in tests, holding on to resources and preventing cleanup on windows.

Comment From: gopherbot

Change https://go.dev/cl/591315 mentions this issue: gopls/internal/cache: stop module cache refresh on view shutdown