aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2023-09-09 04:14:42 -0700
committerGopher Robot <gobot@golang.org>2023-09-12 20:24:06 +0000
commit2be7b1a4ace278a76ea9d34f8caa9290a249f28a (patch)
tree265124cd40d8c0ab59cf846e12cdda8b04b33e69 /src
parentca102e5c4a65c942856faa18557261f8297e72d3 (diff)
downloadgo-2be7b1a4ace278a76ea9d34f8caa9290a249f28a.tar.xz
os: fix TestRenameCaseDifference
Saw this failing on windows like this: --- FAIL: TestRenameCaseDifference (2.96s) --- FAIL: TestRenameCaseDifference/dir (1.64s) testing.go:1226: TempDir RemoveAll cleanup: remove C:\Users\gopher\AppData\Local\Temp\1\TestRenameCaseDifferencedir1375918868\001: The process cannot access the file because it is being used by another process. --- FAIL: TestRenameCaseDifference/file (1.32s) testing.go:1226: TempDir RemoveAll cleanup: remove C:\Users\gopher\AppData\Local\Temp\1\TestRenameCaseDifferencefile3272269402\001: The process cannot access the file because it is being used by another process. FAIL The reason might be the directory fd is not closed. This may be mitigated by retries in removeAll function from testing package, but apparently it does not succeed all the time. A link to the failed run which made me look into this: https://ci.chromium.org/ui/p/golang/builders/try/gotip-windows-386/b8770439049015378129/overview Change-Id: Ibebe94958d1aef8d1d0eca8a969675708cd27a7e Reviewed-on: https://go-review.googlesource.com/c/go/+/527175 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Rob Pike <r@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/os/os_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/os/os_test.go b/src/os/os_test.go
index 25837dce9e..da70c398e8 100644
--- a/src/os/os_test.go
+++ b/src/os/os_test.go
@@ -1180,6 +1180,7 @@ func TestRenameCaseDifference(pt *testing.T) {
// Stat does not return the real case of the file (it returns what the called asked for)
// So we have to use readdir to get the real name of the file.
dirNames, err := fd.Readdirnames(-1)
+ fd.Close()
if err != nil {
t.Fatalf("readdirnames: %s", err)
}