Skip to content

Commit 95544cc

Browse files
author
Bryan C. Mills
committed
net: ignore or skip known-flaky localhost Dial operations on macOS 10.12 builder
Fixes #22019 Fixes #32919 Change-Id: I60bf6c69b18c3e2d78b494e54adc958fe40134da Reviewed-on: https://go-review.googlesource.com/c/go/+/202618 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 07ccdeb commit 95544cc

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/net/dial_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,11 @@ func TestDialerLocalAddr(t *testing.T) {
639639
}
640640
c, err := d.Dial(tt.network, addr)
641641
if err == nil && tt.error != nil || err != nil && tt.error == nil {
642-
// On Darwin this occasionally times out.
643-
// We don't know why. Issue #22019.
644-
if runtime.GOOS == "darwin" && tt.error == nil && os.IsTimeout(err) {
642+
// A suspected kernel bug in macOS 10.12 occasionally results in
643+
// timeout errors when dialing address ::1. The errors have not
644+
// been observed on newer versions of the OS, so we don't plan to work
645+
// around them. See https://golang.org/issue/22019.
646+
if tt.raddr == "::1" && os.Getenv("GO_BUILDER_NAME") == "darwin-amd64-10_12" && os.IsTimeout(err) {
645647
t.Logf("ignoring timeout error on Darwin; see https://golang.org/issue/22019")
646648
} else {
647649
t.Errorf("%s %v->%s: got %v; want %v", tt.network, tt.laddr, tt.raddr, err, tt.error)

src/net/server_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ func TestTCPServer(t *testing.T) {
104104
if perr := parseDialError(err); perr != nil {
105105
t.Error(perr)
106106
}
107+
if tt.taddr == "::1" && os.Getenv("GO_BUILDER_NAME") == "darwin-amd64-10_12" && os.IsTimeout(err) {
108+
// A suspected kernel bug in macOS 10.12 occasionally results in
109+
// "i/o timeout" errors when dialing address ::1. The errors have not
110+
// been observed on newer versions of the OS, so we don't plan to work
111+
// around them. See https://golang.org/issue/32919.
112+
t.Logf("ignoring error on known-flaky macOS 10.12 builder: %v", err)
113+
continue
114+
}
107115
t.Fatal(err)
108116
}
109117
defer c.Close()

src/runtime/crash_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,14 @@ func TestRecoverBeforePanicAfterGoexit(t *testing.T) {
435435
}
436436

437437
func TestNetpollDeadlock(t *testing.T) {
438+
if os.Getenv("GO_BUILDER_NAME") == "darwin-amd64-10_12" {
439+
// A suspected kernel bug in macOS 10.12 occasionally results in
440+
// an apparent deadlock when dialing localhost. The errors have not
441+
// been observed on newer versions of the OS, so we don't plan to work
442+
// around them. See https://golang.org/issue/22019.
443+
testenv.SkipFlaky(t, 22019)
444+
}
445+
438446
t.Parallel()
439447
output := runTestProg(t, "testprognet", "NetpollDeadlock")
440448
want := "done\n"

0 commit comments

Comments
 (0)