]> Cypherpunks repositories - gostls13.git/commitdiff
os: check for ErrNotExist instead of ErrExist in TestNonPollable
authorBryan C. Mills <bcmills@google.com>
Wed, 19 Apr 2023 13:56:45 +0000 (09:56 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 19 Apr 2023 14:12:49 +0000 (14:12 +0000)
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>

src/os/fifo_test.go

index 7a6acce1af47eae243abf70740af680fee0920ad..867c294f5ecbbacb7b30517300a242ab58217724 100644 (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)