1
0
mirror of https://github.com/golang/go synced 2024-11-22 21:50:03 -07:00

os: check for ErrNotExist instead of ErrExist in TestNonPollable

An apparent typo in CL 484837 caused the test to check for ErrExist
instead of ErrNotExist when opening /dev/net/tun for read. That causes
the test to fail on platforms where /dev/net/ton does not exist,
such as on the darwin-amd64-longtest builder.

Updates #59545.

Change-Id: I9402ce0dba11ab459674e8358ae9a8b97eabc8d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/486255
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Commit-Queue: Bryan Mills <bcmills@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Bryan C. Mills 2023-04-19 09:56:45 -04:00 committed by Gopher Robot
parent d93f02010c
commit 8c2ff88c61

View File

@ -79,7 +79,7 @@ func TestNonPollable(t *testing.T) {
f, err := os.OpenFile(nonPollable, os.O_RDWR, 0)
if err != nil {
if errors.Is(err, fs.ErrExist) || errors.Is(err, fs.ErrPermission) || testenv.SyscallIsNotSupported(err) {
if errors.Is(err, fs.ErrNotExist) || errors.Is(err, fs.ErrPermission) || testenv.SyscallIsNotSupported(err) {
t.Skipf("can't open %q: %v", nonPollable, err)
}
t.Fatal(err)