]> Cypherpunks repositories - gostls13.git/commit
testing: retry spurious errors from RemoveAll for temp directories
authorBryan C. Mills <bcmills@google.com>
Mon, 13 Dec 2021 19:28:17 +0000 (14:28 -0500)
committerBryan Mills <bcmills@google.com>
Tue, 14 Dec 2021 19:53:20 +0000 (19:53 +0000)
commitd407a8c3c49f11980f224d204147eff8fcb087f4
tree7633d849e2070cc4bf6219ef0b827de0bdd0d03c
parent265fbaa94b8614cbd861711d7f7c6d278dc1ddba
testing: retry spurious errors from RemoveAll for temp directories

This works around what appears to be either a kernel bug or a Go
runtime or syscall bug affecting certain Windows versions
(possibly all pre-2016?).

The retry loop is a simplified version of the one used in
cmd/go/internal/robustio. We use the same 2-second arbitrary timeout
as was used in that package, since it seems to be reliable in practice
on the affected builders. (If it proves to be too short, we can
lengthen it, within reason, in a followup CL.)

Since this puts a higher-level workaround in place, we can also revert
the lower-level workaround added to a specific test in CL 345670.

This addresses the specific occurrences of the bug for users of
(*testing.T).TempDir, but does not fix the underlying bug for Go users
outside the "testing" package (which remains open as #25965).

Fixes #50051
Updates #48012
Updates #25965

Change-Id: I35be7125f32f05c8350787f5ca9a22974b8d0770
Reviewed-on: https://go-review.googlesource.com/c/go/+/371296
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Patrik Nyblom <pnyb@google.com>
Trust: Patrik Nyblom <pnyb@google.com>
Run-TryBot: Patrik Nyblom <pnyb@google.com>
src/runtime/syscall_windows_test.go
src/testing/testing.go
src/testing/testing_other.go [new file with mode: 0644]
src/testing/testing_windows.go [new file with mode: 0644]