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

testing: "Access is denied." when cleaning up TempDir on windows-amd64-2012 #50051

Closed
bcmills opened this issue Dec 8, 2021 · 5 comments
Closed
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Windows release-blocker
Milestone

Comments

@bcmills
Copy link
Member

bcmills commented Dec 8, 2021

greplogs --dashboard -md -l -e 'TempDir RemoveAll cleanup: CreateFile .*: Access is denied.'

2021-12-08T15:30:52-9fe77de/windows-amd64-2012

--- FAIL: TestRWithNonexistentFile (0.71s)
    testing.go:1091: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestRWithNonexistentFile1327565502\001\pack.exe: Access is denied.
FAIL
FAIL	cmd/pack	4.162s

2021-10-27T21:37:54-749f6e9/windows-amd64-2012

--- FAIL: TestDefaultLinkerDWARF (1.25s)
    file_test.go:395: Testprog output:
        base=0x110000
        main=0x19d040
        offset=0x8d040
    file_test.go:442: Found main.main
    testing.go:1090: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestDefaultLinkerDWARF1018842931\001\a.exe: Access is denied.
FAIL
FAIL	debug/pe	4.240s

2021-10-15T16:57:36-a80e53e/windows-amd64-2012

--- FAIL: TestExternalLinkerDWARF (1.24s)
    file_test.go:395: Testprog output:
        base=0x70000
        main=0xfcc60
        offset=0x8cc60
    file_test.go:442: Found main.main
    testing.go:1059: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestExternalLinkerDWARF1567542787\001\a.exe: Access is denied.
FAIL
FAIL	debug/pe	4.089s

2021-06-16T16:38:43-a294e4e/windows-amd64-2012

--- FAIL: TestRWithNonexistentFile (0.73s)
    testing.go:950: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestRWithNonexistentFile2669366332\001\pack.exe: Access is denied.
FAIL
FAIL	cmd/pack	3.283s

2021-06-08T20:39:45-cb80937/windows-amd64-2012

--- FAIL: TestDefaultLinkerDWARF (1.14s)
    file_test.go:395: Testprog output:
        base=0x1340000
        main=0x13cf740
        offset=0x8f740
    file_test.go:442: Found main.main
    testing.go:950: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestDefaultLinkerDWARF1440061601\001\a.exe: Access is denied.
FAIL
FAIL	debug/pe	3.841s

2021-05-02T20:59:26-bb09f8a/windows-amd64-2012

--- FAIL: TestRWithNonexistentFile (0.71s)
    testing.go:950: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestRWithNonexistentFile3706200250\001\pack.exe: Access is denied.
FAIL
FAIL	cmd/pack	3.532s

2021-04-30T00:08:50-02ab8d1/windows-amd64-2012

--- FAIL: TestRWithNonexistentFile (0.72s)
    testing.go:950: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestRWithNonexistentFile883083571\001\pack.exe: Access is denied.
FAIL
FAIL	cmd/pack	3.707s

2021-04-21T13:27:17-381252f/windows-amd64-2012

--- FAIL: TestDefaultLinkerDWARF (1.25s)
    file_test.go:395: Testprog output:
        base=0x240000
        main=0x2cf440
        offset=0x8f440
    file_test.go:442: Found main.main
    testing.go:947: TempDir RemoveAll cleanup: CreateFile C:\Users\gopher\AppData\Local\Temp\1\TestDefaultLinkerDWARF1597920265\001\a.exe: Access is denied.
FAIL
FAIL	debug/pe	4.436s
@bcmills
Copy link
Member Author

bcmills commented Dec 8, 2021

See previously #25965, #48012, #45672.

@bcmills bcmills added this to the Go1.18 milestone Dec 10, 2021
@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. OS-Windows okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 release-blocker labels Dec 10, 2021
@bcmills
Copy link
Member Author

bcmills commented Dec 10, 2021

The straightforward fix for these tests in particular is to make the testing package use essentially the same retry loop on Windows that cmd/go itself uses.

Marking as release-blocker (via #11811) because this is a recurring source of test failures on the dashboard. (I can mail a fix at some point in the next week or so.)

That won't fix #25965 in the general case, but it will at least fix the common-case failures that occur via testing.TempDir().

@bcmills bcmills self-assigned this Dec 10, 2021
@gopherbot
Copy link

gopherbot commented Dec 13, 2021

Change https://golang.org/cl/371296 mentions this issue: testing: retry spurious errors from RemoveAll for temp directories

@gopherbot
Copy link

gopherbot commented Mar 2, 2022

Change https://go.dev/cl/388916 mentions this issue: testing: include ERROR_SHARING_VIOLATION in Windows cleanup retries

gopherbot pushed a commit that referenced this issue Mar 3, 2022
Fixes #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>
@gopherbot
Copy link

gopherbot commented May 23, 2022

Change https://go.dev/cl/407877 mentions this issue: [release-branch.go1.18] testing: include ERROR_SHARING_VIOLATION in Windows cleanup retries

@rsc rsc unassigned bcmills Jun 22, 2022
gopherbot pushed a commit that referenced this issue Jul 25, 2022
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Windows release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants