]> Cypherpunks repositories - gostls13.git/commitdiff
sync: give finalizers more time in TestPoolGC
authorRuss Cox <rsc@golang.org>
Fri, 7 Mar 2014 21:08:12 +0000 (16:08 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 7 Mar 2014 21:08:12 +0000 (16:08 -0500)
If we report a leak, make sure we've waited long enough to be sure.
The new sleep regimen waits 1.05 seconds before failing; the old
one waited 0.005 seconds.

(The single linux/amd64 failure in this test feels more like a
timing problem than a leak. I don't want to spend time on it unless
we're sure.)

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/72630043

src/pkg/sync/pool_test.go

index a34719ab2ce0a99f1e2f5ae429fd960f1604c637..e444e50e5ed9038a0067482e7609401691fa7e04 100644 (file)
@@ -87,7 +87,7 @@ func TestPoolGC(t *testing.T) {
        }
        for i := 0; i < 5; i++ {
                runtime.GC()
-               time.Sleep(time.Millisecond)
+               time.Sleep(time.Duration(i*100+10) * time.Millisecond)
                // 1 pointer can remain on stack or elsewhere
                if atomic.LoadUint32(&fin) >= N-1 {
                        return