1
0
mirror of https://github.com/golang/go synced 2024-09-24 23:20:12 -06:00

net: during short test, don't bother timeout longer than expected

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5716053
This commit is contained in:
Shenghou Ma 2012-03-03 00:50:18 +08:00
parent 6a005cb03f
commit a3caf073a5

View 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
}