-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
testing: TempDir RemoveAll cleanup failures with "The process cannot access the file because it is being used by another process." #51442
Comments
(This error message is 0x20 |
Change https://go.dev/cl/388916 mentions this issue: |
Apologies for commenting on a closed issue. However, I wanted to ask if there is any chance this makes its way out prior to 1.19? |
@bhasden Are you encountering this yourself? What Go version and what GOOS/GOARCH? Thanks. |
FWIW, this fix would be easy to backport to Go 1.18, but somewhat less trivial to backport to Go 1.17 (it would also need CL 371296, which is a bit more invasive). There is also a workaround that you can apply for your own specific tests independent of the Go version: you can |
I believe I'm running into this same issue in Golang 1.18.1 and 1.18.2 (only two versions I've tested) with some casbin tests that are loading a model configuration file. It's only reproducible in Windows. Team members on non-Windows machines are not running into the issue. go env output:
|
@gopherbot Please open backport to 1.18. At least one person is encountering this problem in 1.18. There are workarounds but they are awkward. The fix would be harder to backport to earlier releases. |
Backport issue(s) opened: #52986 (for 1.18). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/407877 mentions this issue: |
…indows cleanup retries Fixes #52986 Updates #51442 Updates #50051 Change-Id: I1bfbc08c907077467fd50febbec6299a9b73af41 Reviewed-on: https://go-review.googlesource.com/c/go/+/388916 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit eeb9f09) Reviewed-on: https://go-review.googlesource.com/c/go/+/407877 Reviewed-by: Nooras Saba <saba@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com>
… windows bug fix related to the following issue: golang/go#51442
I'm still experiencing this issue in
@bcmills this workaround still works. It looks like the 2 seconds timeout in the |
@i4ki This issue has been closed for almost a year, and we think it is fixed. If you are seeing a problem with 1.20, please open a new issue with reproduction details. It may be the same problem, but it may be a new one. Thanks. |
I'm experiencing the same error in syncthing's test suite on go 1.20.3: go test -r TestHandleFile ./...
...
--- FAIL: TestHandleFile (1.60s)
testing.go:1206: TempDir RemoveAll cleanup: remove C:\Users\ross\AppData\Local\Temp\TestHandleFile1557195908\001: The process cannot access the file because it is being used by another process.
FAIL
FAIL github.com/syncthing/syncthing/lib/model 1.821s
...
--- FAIL: TestHandleFileWithTemp (1.45s)
testing.go:1206: TempDir RemoveAll cleanup: remove C:\Users\ross\AppData\Local\Temp\TestHandleFileWithTemp2880978547\001: The process cannot access the file because it is being used by another process.
FAIL
FAIL github.com/syncthing/syncthing/lib/model 1.578s |
Syncthing is solving this by rewriting the code to use an emulated file system in syncthing/syncthing#8889 |
@rasa, as far as we know the retry loop that was added for this issue works. |
This can probably be fixed by expanding the set of errors handled by the retry loop added for #50051.
greplogs --dashboard -md -l -e 'TempDir RemoveAll cleanup: .* The process cannot access the file because it is being used by another process\.'
2022-02-25T23:38:11-01e522a/windows-amd64-2012
2021-10-28T18:10:50-2bc8ed8/windows-amd64-2012
2021-10-14T18:43:59-765c911/windows-amd64-2012
2021-09-30T19:56:27-70b1a45/windows-amd64-2012
2021-09-17T19:32:44-74e384f/windows-amd64-2012
2021-03-09T08:19:14-b70a2bc/windows-386-2008
2021-03-09T08:19:14-b70a2bc/windows-amd64-2008
2021-03-09T08:19:14-b70a2bc/windows-amd64-2012
2021-03-09T08:19:14-b70a2bc/windows-amd64-2016
2021-03-09T08:19:14-b70a2bc/windows-amd64-longtest
2021-03-09T08:19:14-b70a2bc/windows-amd64-race
2021-03-09T08:19:14-b70a2bc/windows-arm-zx2c4
2021-03-09T07:44:18-437d229/windows-amd64-2008
2021-03-09T07:44:18-437d229/windows-amd64-2012
2021-03-09T07:44:18-437d229/windows-amd64-race
2021-03-09T07:44:18-437d229/windows-arm-zx2c4
2021-03-09T02:20:55-618b66e/windows-amd64-2008
2021-03-09T02:20:55-618b66e/windows-amd64-2012
2021-03-09T02:20:55-618b66e/windows-amd64-2016
2021-03-09T02:20:55-618b66e/windows-amd64-race
2021-03-09T02:20:55-618b66e/windows-arm-zx2c4
2021-03-08T23:13:52-b6def6a/windows-amd64-2008
2021-03-08T23:13:52-b6def6a/windows-amd64-2012
2021-03-08T23:13:52-b6def6a/windows-amd64-2016
2021-03-08T23:13:52-b6def6a/windows-amd64-race
2021-03-08T20:41:06-a08adda/windows-386-2008
2021-03-08T20:41:06-a08adda/windows-amd64-2008
2021-03-08T20:41:06-a08adda/windows-amd64-2016
2021-03-08T20:41:06-a08adda/windows-amd64-longtest
2021-03-08T20:41:06-a08adda/windows-amd64-race
2021-03-08T20:03:01-bd37284/windows-386-2008
2021-03-08T20:03:01-bd37284/windows-amd64-2008
2021-03-08T20:03:01-bd37284/windows-amd64-2012
2021-03-08T20:03:01-bd37284/windows-amd64-2016
The text was updated successfully, but these errors were encountered: