]> Cypherpunks repositories - gostls13.git/commitdiff
net: increase timeout in TestWriteTimeoutFluctuation on darwin/arm
authorMikio Hara <mikioh.mikioh@gmail.com>
Sun, 10 May 2015 14:11:04 +0000 (23:11 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Mon, 11 May 2015 06:03:40 +0000 (06:03 +0000)
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 <minux@golang.org>
src/net/timeout_test.go

index cafa3755f6ce20ece88bf13b1109b12698482a99..9688c21699ec6bccf37752d5ed8e475ddb5d3d1e 100644 (file)
@@ -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)