Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls/internal/regtest/misc: TestRenamePackageWithDifferentDirectoryPath failures #56038

Closed
gopherbot opened this issue Oct 4, 2022 · 3 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@gopherbot
Copy link

#!watchflakes
post <- pkg == "golang.org/x/tools/gopls/internal/regtest/misc" && test == "TestRenamePackageWithDifferentDirectoryPath"

Issue created automatically to collect these failures.

Example (log):

serve.go:438: debug server listening at http://localhost:49810
serve.go:438: debug server listening at http://localhost:49811
2022/10/04 16:11:32 cleaning workspace dir: remove C:\Users\gopher\AppData\Local\Temp\1\gopls-workspace-mod3323859480: The process cannot access the file because it is being used by another process.
2022/10/04 16:11:41 cleaning workspace dir: remove C:\Users\gopher\AppData\Local\Temp\1\gopls-workspace-mod980465144: The process cannot access the file because it is being used by another process.
#### Start Gopls Test Logs for "TestRenamePackageWithDifferentDirectoryPath/default"
[Trace - 16:12:19.589 PM] Sending request 'initialize - (1)'.
Params: {"processId":0,"clientInfo":{"name":"fakeclient","version":"v1.0.0"},"rootUri":"","capabilities":{"workspace":{"workspaceEdit":{"resourceOperations":["rename"]},"didChangeConfiguration":{},"didChangeWatchedFiles":{"dynamicRegistration":true},"configuration":true},"textDocument":{"completion":{"completionItem":{"snippetSupport":true,"commitCharactersSupport":false,"documentationFormat":null,"deprecatedSupport":false,"preselectSupport":false,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":false,"resolveSupport":{"properties":null},"insertTextModeSupport":{"valueSet":null},"labelDetailsSupport":false}},"hover":{},"documentSymbol":{},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":null}}},"rename":{},"foldingRange":{},"publishDiagnostics":{},"semanticTokens":{"requests":{"range":false,"full":true},"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":null,"formats":null}},"window":{"workDoneProgress":true}},"initializationOptions":{"completionBudget":"10s","diagnosticsDelay":"10ms","env":{"GO111MODULE":"","GOMODCACHE":"","GOPACKAGESDRIVER":"off","GOPATH":"C:\\Users\\gopher\\AppData\\Local\\Temp\\1\\gopls-regtest-2615586591\\TestRenamePackageWithDifferentDirectoryPath\\default\\gopath","GOPROXY":"file:///C:/Users/gopher/AppData/Local/Temp/1/gopls-regtest-2615586591/TestRenamePackageWithDifferentDirectoryPath/default/proxy","GOSUMDB":"off"},"verboseWorkDoneProgress":true},"trace":"messages","workspaceFolders":[{"uri":"file:///C:/Users/gopher/AppData/Local/Temp/1/gopls-regtest-2615586591/TestRenamePackageWithDifferentDirectoryPath/default/work","name":"work"}]}


[Trace - 16:12:19.589 PM] Received response 'initialize - (1)' in 0ms.
...

[Trace - 16:12:20.019 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///C:/Users/gopher/AppData/Local/Temp/1/gopls-regtest-2615586591/TestRenamePackageWithDifferentDirectoryPath/default/work/nested/a.go","languageId":"go","version":1,"text":"package nested\n\nconst A = 1\n\n"}}


#### End Gopls Test Logs for "TestRenamePackageWithDifferentDirectoryPath/default"
--- FAIL: TestRenamePackageWithDifferentDirectoryPath (3.13s)
    --- FAIL: TestRenamePackageWithDifferentDirectoryPath/default (0.96s)
        rename_test.go:251: rename C:\Users\gopher\AppData\Local\Temp\1\gopls-regtest-2615586591\TestRenamePackageWithDifferentDirectoryPath\default\work\lib C:\Users\gopher\AppData\Local\Temp\1\gopls-regtest-2615586591\TestRenamePackageWithDifferentDirectoryPath\default\work\nested: Access is denied.
2022/10/04 16:12:25 cleaning workspace dir: remove C:\Users\gopher\AppData\Local\Temp\1\gopls-workspace-mod1979176953: The process cannot access the file because it is being used by another process.

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 4, 2022
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "golang.org/x/tools/gopls/internal/regtest/misc" && test == "TestRenamePackageWithDifferentDirectoryPath"
2022-10-04 16:03 windows-amd64-longtest tools@40dabfa8 go@6a9aaf1f x/tools/gopls/internal/regtest/misc.TestRenamePackageWithDifferentDirectoryPath (log)
serve.go:438: debug server listening at http://localhost:49810
serve.go:438: debug server listening at http://localhost:49811
2022/10/04 16:11:32 cleaning workspace dir: remove C:\Users\gopher\AppData\Local\Temp\1\gopls-workspace-mod3323859480: The process cannot access the file because it is being used by another process.
2022/10/04 16:11:41 cleaning workspace dir: remove C:\Users\gopher\AppData\Local\Temp\1\gopls-workspace-mod980465144: The process cannot access the file because it is being used by another process.
#### Start Gopls Test Logs for "TestRenamePackageWithDifferentDirectoryPath/default"
[Trace - 16:12:19.589 PM] Sending request 'initialize - (1)'.
Params: {"processId":0,"clientInfo":{"name":"fakeclient","version":"v1.0.0"},"rootUri":"","capabilities":{"workspace":{"workspaceEdit":{"resourceOperations":["rename"]},"didChangeConfiguration":{},"didChangeWatchedFiles":{"dynamicRegistration":true},"configuration":true},"textDocument":{"completion":{"completionItem":{"snippetSupport":true,"commitCharactersSupport":false,"documentationFormat":null,"deprecatedSupport":false,"preselectSupport":false,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":false,"resolveSupport":{"properties":null},"insertTextModeSupport":{"valueSet":null},"labelDetailsSupport":false}},"hover":{},"documentSymbol":{},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":null}}},"rename":{},"foldingRange":{},"publishDiagnostics":{},"semanticTokens":{"requests":{"range":false,"full":true},"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":null,"formats":null}},"window":{"workDoneProgress":true}},"initializationOptions":{"completionBudget":"10s","diagnosticsDelay":"10ms","env":{"GO111MODULE":"","GOMODCACHE":"","GOPACKAGESDRIVER":"off","GOPATH":"C:\\Users\\gopher\\AppData\\Local\\Temp\\1\\gopls-regtest-2615586591\\TestRenamePackageWithDifferentDirectoryPath\\default\\gopath","GOPROXY":"file:///C:/Users/gopher/AppData/Local/Temp/1/gopls-regtest-2615586591/TestRenamePackageWithDifferentDirectoryPath/default/proxy","GOSUMDB":"off"},"verboseWorkDoneProgress":true},"trace":"messages","workspaceFolders":[{"uri":"file:///C:/Users/gopher/AppData/Local/Temp/1/gopls-regtest-2615586591/TestRenamePackageWithDifferentDirectoryPath/default/work","name":"work"}]}


[Trace - 16:12:19.589 PM] Received response 'initialize - (1)' in 0ms.
...

[Trace - 16:12:20.019 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///C:/Users/gopher/AppData/Local/Temp/1/gopls-regtest-2615586591/TestRenamePackageWithDifferentDirectoryPath/default/work/nested/a.go","languageId":"go","version":1,"text":"package nested\n\nconst A = 1\n\n"}}


#### End Gopls Test Logs for "TestRenamePackageWithDifferentDirectoryPath/default"
--- FAIL: TestRenamePackageWithDifferentDirectoryPath (3.13s)
    --- FAIL: TestRenamePackageWithDifferentDirectoryPath/default (0.96s)
        rename_test.go:251: rename C:\Users\gopher\AppData\Local\Temp\1\gopls-regtest-2615586591\TestRenamePackageWithDifferentDirectoryPath\default\work\lib C:\Users\gopher\AppData\Local\Temp\1\gopls-regtest-2615586591\TestRenamePackageWithDifferentDirectoryPath\default\work\nested: Access is denied.
2022/10/04 16:12:25 cleaning workspace dir: remove C:\Users\gopher\AppData\Local\Temp\1\gopls-workspace-mod1979176953: The process cannot access the file because it is being used by another process.

watchflakes

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Oct 4, 2022
@gopherbot gopherbot added this to the Unreleased milestone Oct 4, 2022
@suzmue suzmue modified the milestones: Unreleased, gopls/later Oct 5, 2022
@gopherbot
Copy link
Author

Change https://go.dev/cl/440181 mentions this issue: gopls/internal/lsp/fake: retry ephemeral errors when renaming on windows

gopherbot pushed a commit to golang/tools that referenced this issue Oct 7, 2022
Investigation of renaming flakes revealed that renaming is known to be
flaky on windows, and the go command has a robustio package that works
around known flakes for certain IO operations on darwin and windows.

Rather than duplicate this logic piecemeal, copy the entire robustio
package to the gopls module, along with a script to sync it from GOROOT
using go generate. Use this new package to de-flake renaming, and
replace an existing workaround.

The copy script got a little out of hand at the point where I needed to
add +build constraints. Nevertheless, I've decided to keep it with the
caveat that it may be removed if it proves too difficult to maintain. As
is, it at least serves as documentation for how the sync was done.

For golang/go#56040
For golang/go#56039
For golang/go#56038
For golang/go#55324

Change-Id: Ifeda408ac44a2866e84015a2a38ae340dc0a88bb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/440181
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
@rsc
Copy link
Contributor

rsc commented Oct 13, 2022

Folding into #56039.

@rsc rsc closed this as completed Oct 13, 2022
@findleyr findleyr modified the milestones: gopls/later, gopls/v0.10.0 Oct 20, 2022
@golang golang locked and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants