sync: give finalizers more time in TestPoolGC

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
This commit is contained in:
Russ Cox 2014-03-07 16:08:12 -05:00
parent 3d869c6e0c
commit e721778f3e
1 changed files with 1 additions and 1 deletions

View 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