]> Cypherpunks repositories - gostls13.git/commitdiff
net: during short test, don't bother timeout longer than expected
authorShenghou Ma <minux.ma@gmail.com>
Fri, 2 Mar 2012 16:50:18 +0000 (00:50 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 2 Mar 2012 16:50:18 +0000 (00:50 +0800)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5716053

src/pkg/net/timeout_test.go

index bae37c86b2ed3b32fa511b387b5fca94b8f5c2d7..ef350f0f946f99fad4c4a996a8cc703ff3507f1f 100644 (file)
@@ -40,7 +40,7 @@ func testTimeout(t *testing.T, network, addr string, readFrom bool) {
                        errc <- fmt.Errorf("fd.%s on %s %s did not return 0, timeout: %v, %v", what, network, addr, n, err1)
                        return
                }
-               if dt := t1.Sub(t0); dt < 50*time.Millisecond || dt > 250*time.Millisecond {
+               if dt := t1.Sub(t0); dt < 50*time.Millisecond || !testing.Short() && dt > 250*time.Millisecond {
                        errc <- fmt.Errorf("fd.%s on %s %s took %s, expected 0.1s", what, network, addr, dt)
                        return
                }