Skip to content

x/tools/gopls: 5x slowdown in cmd tests #37365

@findleyr

Description

@findleyr

While investigating #37318, I noticed that tests for golang.org/x/tools/internal/lsp/cmd were also timing out. For example: https://build.golang.org/log/a7e57b48b2eb87387651b04e268638d5b1b25f9d

Looking into this, it appears that cmd tests got significantly slower recently. Bisecting, it looks like this is a result of golang/tools@6dcdf1d. These tests went from ~6s to ~30s on my workstation. That's surprising.

[nyc:tools2]> go test -count=1 ./internal/lsp/cmd                                                                     
ok      golang.org/x/tools/internal/lsp/cmd     5.937s                                                                
[nyc:tools2]> git bisect good                                                                                         
6dcdf1db2c06ad0ebe311c58b8cda17392eb42c2 is the first bad commit
commit 6dcdf1db2c06ad0ebe311c58b8cda17392eb42c2
Author: Rebecca Stambler <rstambler@golang.org>
Date:   Thu Jan 30 21:29:41 2020 -0500
                                                           
    internal/lsp/cache: refactor functions that return PackageHandles

CC @stamblerre @ianthehat

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions