]> Cypherpunks.ru repositories - gostls13.git/commit
testing/fstest,os: clarify racy behavior of TestFS
authorAustin Clements <austin@google.com>
Thu, 7 Jan 2021 22:50:14 +0000 (17:50 -0500)
committerAustin Clements <austin@google.com>
Fri, 8 Jan 2021 16:34:00 +0000 (16:34 +0000)
commit0c5afc4fb7e3349ec4efdce6554f83554e3d087c
tree9ea7c12d00da0b5e73ba164656e2087187b6d664
parent32afcc94363e15ee2ef0cffec962191a15e73094
testing/fstest,os: clarify racy behavior of TestFS

The testing.TestFS function assumes that the file system it's testing
doesn't change under it. Clarify this in the documentation and fix the
use of os.TestDirFS that's currently susceptible to this race.

Fixes #42637.

Change-Id: Ia7792380726177f8953d150ee87381b66cb01cb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/282452
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/os/os_test.go
src/os/testdata/dirfs/a [new file with mode: 0644]
src/os/testdata/dirfs/b [new file with mode: 0644]
src/os/testdata/dirfs/dir/x [new file with mode: 0644]
src/testing/fstest/testfs.go