aboutsummaryrefslogtreecommitdiff
path: root/src/net/dial_test.go
diff options
context:
space:
mode:
authorElias Naur <elias.naur@gmail.com>2018-05-17 15:20:57 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2018-05-17 14:27:12 +0000
commit74604bb517b8615331aae44166e0368b25f6a4cb (patch)
tree60decbe95b36a33ff876ede0330a29b115b3f0d9 /src/net/dial_test.go
parent67894aa7e20cc57bfe0acb289efc1671263f439d (diff)
downloadgo-74604bb517b8615331aae44166e0368b25f6a4cb.tar.gz
go-74604bb517b8615331aae44166e0368b25f6a4cb.zip
net: skip external net tests on iOS
CL 113095 tried to deflake net tests on iOS by skipping the test that uses the most sockets. That didn't work well enough and will be reverted in CL 113555. The flakes appeared after the iOS exec harness started to forward environment variables, causing testenv.Builder to be non-empty on the iOS builder. This CL attempts to fix the flakes with the more conservative strategy of skipping tests that only run on builders. The skipped tests happen to be those requiring external network access; it's plausible that the iOS builder network isn't reliable enough to run the many parallel DNS lookups and dial outs, while keeping the number of open file descriptors below the 250 limit. Change-Id: I9cafdaf2845dd6f3844c4819dcaaaa5970f5da15 Reviewed-on: https://go-review.googlesource.com/113575 Run-TryBot: Elias Naur <elias.naur@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/dial_test.go')
-rw-r--r--src/net/dial_test.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/net/dial_test.go b/src/net/dial_test.go
index b5f1dc9e98..811e417cd7 100644
--- a/src/net/dial_test.go
+++ b/src/net/dial_test.go
@@ -749,9 +749,8 @@ func TestDialCancel(t *testing.T) {
switch testenv.Builder() {
case "linux-arm64-buildlet":
t.Skip("skipping on linux-arm64-buildlet; incompatible network config? issue 15191")
- case "":
- testenv.MustHaveExternalNetwork(t)
}
+ mustHaveExternalNetwork(t)
if runtime.GOOS == "nacl" {
// nacl doesn't have external network access.
@@ -897,9 +896,7 @@ func TestCancelAfterDial(t *testing.T) {
// if the machine has halfway configured IPv6 such that it can bind on
// "::" not connect back to that same address.
func TestDialListenerAddr(t *testing.T) {
- if testenv.Builder() == "" {
- testenv.MustHaveExternalNetwork(t)
- }
+ mustHaveExternalNetwork(t)
ln, err := Listen("tcp", ":0")
if err != nil {
t.Fatal(err)
@@ -912,3 +909,13 @@ func TestDialListenerAddr(t *testing.T) {
}
c.Close()
}
+
+// mustHaveExternalNetwork is like testenv.MustHaveExternalNetwork
+// except that it won't skip testing on non-iOS builders.
+func mustHaveExternalNetwork(t *testing.T) {
+ t.Helper()
+ ios := runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")
+ if testenv.Builder() == "" || ios {
+ testenv.MustHaveExternalNetwork(t)
+ }
+}