test(teamloader): stop LSP tests from auto-installing gopls by aheritier · Pull Request #4647 · docker/docker-agent · GitHub
Skip to content

test(teamloader): stop LSP tests from auto-installing gopls - #4647

Merged
aheritier merged 1 commit into
docker:mainfrom
aheritier:fix/flaky-lsp-tests-autoinstall
Oct 20, 2026
Merged

aheritier merged 1 commit into
docker:mainfrom
aheritier:fix/flaky-lsp-tests-autoinstall

Conversation

@aheritier

Copy link
Copy Markdown
Collaborator

Problem

TestGetToolsForAgent_MultipleLSPToolsetsAreCombined, TestGetToolsForAgent_SingleLSPToolsetNotWrapped and TestCreateLSPTool_WorkingDir_ReachesHandler failed together in run 39267593437 with:

go install golang.org/x/tools/gopls@v0.21.0: exit status 1
... read "https://proxy.golang.org/golang.org/x/vuln/@v/v1.1.4.zip": stream error: ... INTERNAL_ERROR

These tests only check toolset wiring (multiplexing, no wrapping, WorkingDir). They never start the server: lsp.ToolSet.Tools() returns the static catalogue before the server connects. But lsp.CreateToolSet calls toolinstall.EnsureCommand, which runs a real go install when gopls isn't on PATH, as on CI runners. That makes the tests depend on the Go module proxy being up.

Fix

Set Version: "false" on those toolsets. It's the existing per-toolset auto-install opt-out. I didn't use DOCKER_AGENT_AUTO_INSTALL=false because the tests call t.Parallel(), which rules out t.Setenv.

Verification

  • I ran the three tests with gopls removed from PATH and an empty DOCKER_AGENT_TOOLS_DIR. They passed in ~0.01s each, printed no Installing gopls, and left the tools dir empty.
  • go test -race ./pkg/teamloader/ passes.
  • golangci-lint v2.14.0 and go run ./lint . report no issues.

Fixes #4642
Fixes #4643
Fixes #4644

The LSP toolset tests only check toolset wiring and never start the
server, but lsp.CreateToolSet calls toolinstall.EnsureCommand, which
runs `go install gopls` when it is not on PATH. On CI that made them
fail whenever proxy.golang.org hiccuped.

Use the per-toolset `version: false` opt-out so no install happens.

Fixes docker#4642
Fixes docker#4643
Fixes docker#4644
Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:38
@aheritier
aheritier requested a review from a team as a code owner October 19, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The existing installation opt-out preserves the tested behavior, and these tests do not require a running language server.

No open issues 🎉

What changed in this PR

Removes the Go module proxy dependency from three teamloader wiring tests, addressing the reported CI failures without changing production behavior.

Changes:

  • Uses Version: "false" to disable automatic gopls installation.
  • Preserves existing multiplexing, wrapping, and working-directory assertions.
File Description
pkg/​teamloader/​teamloader_test.go Disables installation in single- and multiple-LSP wiring tests.
pkg/​teamloader/​registry_test.go Disables installation in the working-directory propagation test.

Review effort: Balanced

@aheritier aheritier added area/agent For work that has to do with the general agent loop/agentic features of the app area/testing Test infrastructure, CI/CD, test runners, evaluation kind/test Test-only changes labels Oct 19, 2026
@aheritier
aheritier enabled auto-merge October 19, 2026 20:04
@aheritier
aheritier added this pull request to the merge queue Oct 20, 2026
Merged via the queue into docker:main with commit 42f2f75 Oct 20, 2026
16 checks passed
@aheritier
aheritier deleted the fix/flaky-lsp-tests-autoinstall branch October 20, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent For work that has to do with the general agent loop/agentic features of the app area/testing Test infrastructure, CI/CD, test runners, evaluation kind/test Test-only changes

Projects

None yet

3 participants