diff --git a/internal/lsp/regtest/regtest.go b/internal/lsp/regtest/regtest.go index 35cf3f33cb..c1df26d8aa 100644 --- a/internal/lsp/regtest/regtest.go +++ b/internal/lsp/regtest/regtest.go @@ -87,6 +87,9 @@ func DefaultModes() Mode { func Main(m *testing.M, hook func(*source.Options)) { testenv.ExitIfSmallMachine() + // Disable GOPACKAGESDRIVER, as it can cause spurious test failures. + os.Setenv("GOPACKAGESDRIVER", "off") + flag.Parse() if os.Getenv("_GOPLS_TEST_BINARY_RUN_AS_GOPLS") == "true" { tool.Main(context.Background(), cmd.New("gopls", "", nil, nil), os.Args[1:])