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
cmd/go: TestLocalImportsHard fails on windows #11217
Comments
My best guess is that os.RemoveAll("./hello.exe") is failing with the error "Access is denied". Perhaps there is some interference from some other test. Can you reproduce it with -test.v? |
It is hit and miss, but I can reproduce the failure sometimes. Given this changes:
I get this output:
It looks to me that TestLocalImportsEasySub removes ./hello.exe at the end of the test (successfully). But then TestLocalImportsHard (following test) gets "Access is denied" while trying to remove ./hello.exe that does not exists now. Very confusing, but I wouldn't be surprised to discover that this is how Windows work in this situation. Removing executable file after it just finished executing has always been a problem on windows. I don't know of a sure way to know when it is safe to delete. We even have small "sleep" at the end of (*os.process).wait for that reason. I could be missing something here, but I don't see and reasonable resolution here. Maybe we could just have different name for that file for different tests. Alex |
It would be easy to change the executable names in these tests. I can do that but I can't test that it fixes the problem on Windows. Let me know if you would like me to try it. |
CL https://golang.org/cl/11138 mentions this issue. |
From recent build http://build.golang.org/log/05a5e1e4dad8948a11ce786d85222123cbfb10ff
...
--- FAIL: TestLocalImportsHard-2 (0.00s)
go_test.go:152: GetFileAttributesEx ./hello.exe: Access is denied.
FAIL
FAIL cmd/go 37.196s
I can reproduce it here. But I have no idea what the problem is.
Alex
The text was updated successfully, but these errors were encountered: