Skip to content

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

Closed
@bcmills

Description

@bcmills

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

Activity

bcmills

bcmills commented on Dec 8, 2021

@bcmills
ContributorAuthor

See previously #25965, #48012, #45672.

added this to the Go1.18 milestone on Dec 10, 2021
added
NeedsFixThe path to resolution is known, but the work has not been done.
okay-after-beta1Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1
on Dec 10, 2021
bcmills

bcmills commented on Dec 10, 2021

@bcmills
ContributorAuthor

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().

self-assigned this
on Dec 10, 2021
gopherbot

gopherbot commented on Dec 13, 2021

@gopherbot
Contributor

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

removed
okay-after-beta1Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1
on Dec 14, 2021

9 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bcmills@gopherbot@cherrymui

        Issue actions

          testing: "Access is denied." when cleaning up TempDir on windows-amd64-2012 · Issue #50051 · golang/go