]> Cypherpunks repositories - gostls13.git/commitdiff
net: deflake TestDialTimeout
authorAlbert Strasheim <fullung@gmail.com>
Thu, 14 Mar 2013 16:42:29 +0000 (09:42 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 14 Mar 2013 16:42:29 +0000 (09:42 -0700)
Fixes #3867.
Fixes #3307.

R=bradfitz, dvyukov
CC=golang-dev
https://golang.org/cl/7735044

src/pkg/net/dial_test.go

index 2303e8fa46a4e68a4757d244a6c06012f87d94a5..098df738b627dae4330b8f45c79a17fe7227c66a 100644 (file)
@@ -28,12 +28,18 @@ func newLocalListener(t *testing.T) Listener {
 }
 
 func TestDialTimeout(t *testing.T) {
+       origBacklog := listenerBacklog
+       defer func() {
+               listenerBacklog = origBacklog
+       }()
+       listenerBacklog = 1
+
        ln := newLocalListener(t)
        defer ln.Close()
 
        errc := make(chan error)
 
-       numConns := listenerBacklog + 10
+       numConns := listenerBacklog + 100
 
        // TODO(bradfitz): It's hard to test this in a portable
        // way. This is unfortunate, but works for now.