From cbcc7584de99dbefd3e019d2a53442b30d5af989 Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Sun, 10 May 2015 23:11:04 +0900 Subject: [PATCH] net: increase timeout in TestWriteTimeoutFluctuation on darwin/arm On darwin/arm, the test sometimes fails with: Process 557 resuming --- FAIL: TestWriteTimeoutFluctuation (1.64s) timeout_test.go:706: Write took over 1s; expected 0.1s FAIL Process 557 exited with status = 1 (0x00000001) go_darwin_arm_exec: timeout running tests This change increaes timeout on iOS builders from 1s to 3s as a temporarily fix. Updates #10775. Change-Id: Ifdaf99cf5b8582c1a636a0f7d5cc66bb276efd72 Reviewed-on: https://go-review.googlesource.com/9915 Reviewed-by: Minux Ma --- src/net/timeout_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/net/timeout_test.go b/src/net/timeout_test.go index cafa3755f6..9688c21699 100644 --- a/src/net/timeout_test.go +++ b/src/net/timeout_test.go @@ -696,14 +696,18 @@ func TestWriteTimeoutFluctuation(t *testing.T) { } defer c.Close() - max := time.NewTimer(time.Second) + d := time.Second + if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { + d = 3 * time.Second // see golang.org/issue/10775 + } + max := time.NewTimer(d) defer max.Stop() ch := make(chan error) go timeoutTransmitter(c, 100*time.Millisecond, 50*time.Millisecond, 250*time.Millisecond, ch) select { case <-max.C: - t.Fatal("Write took over 1s; expected 0.1s") + t.Fatalf("Write took over %v; expected 0.1s", d) case err := <-ch: if perr := parseWriteError(err); perr != nil { t.Error(perr) -- 2.48.1