]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] os: use an actual RemoveAll failure in TestRemoveAllWithMoreE...
authorBryan C. Mills <bcmills@google.com>
Fri, 25 Oct 2019 19:37:00 +0000 (15:37 -0400)
committerDmitri Shuralyov <dmitshur@golang.org>
Tue, 31 Mar 2020 23:05:42 +0000 (23:05 +0000)
commitf353662952b48af110dc878adfa533745e168716
tree47f2b110886b33c43fbabd8fac757b499cc3c60d
parent7261619113b1f35fc9260a44b66bc1f9a13f142f
[release-branch.go1.13] os: use an actual RemoveAll failure in TestRemoveAllWithMoreErrorThanReqSize

Previously we injected an error, and the injection points were
(empirically) not realistic on some platforms.

Instead, we now make the directory read-only, which (on most
platforms) suffices to prevent the removal of its files.

Also remove unused test hook, as was done in CL 204060.

For #35117.
For #29921.
Fixes #37895.

Change-Id: Ica4e2818566f8c14df3eed7c3b8de5c0abeb6963
Reviewed-on: https://go-review.googlesource.com/c/go/+/203502
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 06bdd52f7540eca9e3ade6e78234d00703f3ee23)
Reviewed-on: https://go-review.googlesource.com/c/go/+/223700
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
src/os/export_test.go
src/os/path.go
src/os/removeall_at.go
src/os/removeall_noat.go
src/os/removeall_test.go