Skip to content

os: TestRemoveAllWithMoreErrorThanReqSize is failing on Plan 9 and Windows #35117

@fhs

Description

@fhs

What version of Go are you using (go version)?

cpu% go version
go version devel +master Wed Oct 23 01:24:58 EDT 2019 plan9/386

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE='on'
GOARCH='386'
GOBIN=''
GOCACHE='/usr/fhs/lib/cache/go-build'
GOENV='/usr/fhs/lib/go/env'
GOEXE=''
GOFLAGS=''
GOHOSTARCH='386'
GOHOSTOS='plan9'
GONOPROXY=''
GONOSUMDB=''
GOOS='plan9'
GOPATH='/home/fhs/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/big/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLDIR='/home/big/go/pkg/tool/plan9_386'
GCCGO='gccgo'
GO386='sse2'
AR='ar'
CC='8c'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/dev/null'
CGO_CFLAGS='-g -O2'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-g -O2'
CGO_FFLAGS='-g -O2'
CGO_LDFLAGS='-g -O2'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m32 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build107333689=/tmp/go-build -gno-record-gcc-switches'

What did you do?

cpu% cd src/os
cpu% go test

What did you expect to see?

All tests passed.

What did you see instead?

--- FAIL: TestRemoveAllWithMoreErrorThanReqSize (0.30s)
    removeall_test.go:447: Want error from RemoveAllTestHook, got nil
FAIL
exit status: 'os.test 129292: 1'
FAIL	os	2.458s

This test doesn't get run with the -short flag, so it's probably not getting run on the plan9 builders.

On Plan 9, we use the "noat" implementation, which is slightly different from the "at" implementation in that it can Remove the parent directory within the for-loop in addition to the Remove at the end of the function.

This test tries to delete 1025 files. The first Readdirnames returns 1024 entries. In the second Readdirnames call, we get the 1 remaining entry. After deleting that one entry, instead of breaking out of the loop, the code tries to Remove the parent directory. Since the Remove succeeds, we return nil. I believe we need to an add additional hook right after this Remove call, and another hook right after we try to Open the deleted parent directory (only reached if hook is set by the test).

@gopherbot Please add labels OS-Plan9, NeedsFix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions