Commit e721778f authored by Russ Cox's avatar Russ Cox

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
parent 3d869c6e
...@@ -87,7 +87,7 @@ func TestPoolGC(t *testing.T) { ...@@ -87,7 +87,7 @@ func TestPoolGC(t *testing.T) {
} }
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
runtime.GC() runtime.GC()
time.Sleep(time.Millisecond) time.Sleep(time.Duration(i*100+10) * time.Millisecond)
// 1 pointer can remain on stack or elsewhere // 1 pointer can remain on stack or elsewhere
if atomic.LoadUint32(&fin) >= N-1 { if atomic.LoadUint32(&fin) >= N-1 {
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment