Skip to content

Commit 728a876

Browse files
committed
net: skip some interface tests on Dragonfly for now
Skipping tests isn't great, but neither is a wall of red masking other potential regressions. Updates #34368 Change-Id: I5fdfa54846dd8d648001594c74f059af8af52247 Reviewed-on: https://go-review.googlesource.com/c/go/+/201482 Run-TryBot: Brad Fitzpatrick <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 2449444 commit 728a876

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/net/interface_test.go

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package net
88

99
import (
1010
"fmt"
11+
"internal/testenv"
1112
"reflect"
1213
"runtime"
1314
"testing"
@@ -50,10 +51,20 @@ func ipv6LinkLocalUnicastAddr(ifi *Interface) string {
5051
return ""
5152
}
5253

53-
func TestInterfaces(t *testing.T) {
54-
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
55-
t.Skipf("sysctl is not supported on iOS")
54+
func condSkipInterfaceTest(t *testing.T) {
55+
t.Helper()
56+
switch runtime.GOOS {
57+
case "darwin":
58+
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
59+
t.Skipf("sysctl is not supported on iOS")
60+
}
61+
case "dragonfly":
62+
testenv.SkipFlaky(t, 34368)
5663
}
64+
}
65+
66+
func TestInterfaces(t *testing.T) {
67+
condSkipInterfaceTest(t)
5768
ift, err := Interfaces()
5869
if err != nil {
5970
t.Fatal(err)
@@ -85,9 +96,7 @@ func TestInterfaces(t *testing.T) {
8596
}
8697

8798
func TestInterfaceAddrs(t *testing.T) {
88-
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
89-
t.Skipf("sysctl is not supported on iOS")
90-
}
99+
condSkipInterfaceTest(t)
91100
ift, err := Interfaces()
92101
if err != nil {
93102
t.Fatal(err)
@@ -107,9 +116,7 @@ func TestInterfaceAddrs(t *testing.T) {
107116
}
108117

109118
func TestInterfaceUnicastAddrs(t *testing.T) {
110-
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
111-
t.Skipf("sysctl is not supported on iOS")
112-
}
119+
condSkipInterfaceTest(t)
113120
ift, err := Interfaces()
114121
if err != nil {
115122
t.Fatal(err)
@@ -137,9 +144,7 @@ func TestInterfaceUnicastAddrs(t *testing.T) {
137144
}
138145

139146
func TestInterfaceMulticastAddrs(t *testing.T) {
140-
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
141-
t.Skipf("sysctl is not supported on iOS")
142-
}
147+
condSkipInterfaceTest(t)
143148
ift, err := Interfaces()
144149
if err != nil {
145150
t.Fatal(err)

0 commit comments

Comments
 (0)