]> Cypherpunks repositories - gostls13.git/commitdiff
net: make TestDialTimeoutFDLeak a bit robust
authorMikio Hara <mikioh.mikioh@gmail.com>
Thu, 13 Dec 2012 07:21:25 +0000 (16:21 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Thu, 13 Dec 2012 07:21:25 +0000 (16:21 +0900)
TestDialTimeoutFDLeak will fail when system state somaxconn is
greater than expected fixed value.

Fixes #4384 (again).

R=fullung, dave, rsc
CC=golang-dev
https://golang.org/cl/6873069

src/pkg/net/dial_test.go

index 3241f34cf07dadc4cbff016b406b63c8f5bd19db..325bd4b87423b66918ad6ea4b79ce3bd53cdc56c 100644 (file)
@@ -241,7 +241,7 @@ func TestDialTimeoutFDLeak(t *testing.T) {
        }
        dials := listenerBacklog + 100
        // used to be listenerBacklog + 5, but was found to be unreliable, issue 4384.
-       maxGoodConnect := 150
+       maxGoodConnect := listenerBacklog + runtime.NumCPU()*10
        resc := make(chan connErr)
        for i := 0; i < dials; i++ {
                go func() {