[tools] gopls/internal/cmd: fix flaky MCP logging test

0 views
Skip to first unread message

Madeline Kalil (Gerrit)

unread,
10:28 AM (13 hours ago) 10:28 AM
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Alan Donovan, Go LUCI, Robert Findley, Hongxiang Jiang, golang-co...@googlegroups.com

Madeline Kalil submitted the change

Change information

Commit message:
gopls/internal/cmd: fix flaky MCP test, disable Close() err logging

The MCPCommandLogging test was flaky because it did not wait for the notification that produced the "notifications/initialized" log. Instead, check for the "initialize" log, which is the request sent when the client attempts to connect to the MCP server.

Also, silence any errors from closing the connection by replacing t.Errorf with t.Logf. Based on the investigation (see https://github.com/golang/go/issues/77336#issuecomment-4090756198), there may be a bug in mcp causing a race condition that affects .Close().

MCP bug reported: https://github.com/modelcontextprotocol/go-sdk/issues/855

For golang/go#77336
Change-Id: I2cbed51cd2e65080dd4fffc519bbcad01eb676bd
Reviewed-by: Alan Donovan <adon...@google.com>
Files:
  • M gopls/internal/cmd/mcp_test.go
Change size: S
Delta: 1 file changed, 27 insertions(+), 8 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Alan Donovan
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I2cbed51cd2e65080dd4fffc519bbcad01eb676bd
Gerrit-Change-Number: 756440
Gerrit-PatchSet: 13
Gerrit-Owner: Madeline Kalil <mka...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
Gerrit-Reviewer: Robert Findley <rfin...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages