From 822158c59c08135dfde42e956b22bd456caa0ab7 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 27 Jan 2019 05:07:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Add=20test=20cases=20for=20sync.?= =?UTF-8?q?Pool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ants_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ants_test.go b/ants_test.go index 4b1b143..36b546f 100644 --- a/ants_test.go +++ b/ants_test.go @@ -82,7 +82,7 @@ func TestAntsPoolGetWorkerFromCache(t *testing.T) { for i := 0; i < AntsSize; i++ { p.Submit(demoFunc) } - time.Sleep(ants.DefaultCleanIntervalTime * time.Second) + time.Sleep(2 * ants.DefaultCleanIntervalTime * time.Second) p.Submit(demoFunc) t.Logf("pool, running workers number:%d", p.Running()) mem := runtime.MemStats{} @@ -100,7 +100,7 @@ func TestAntsPoolWithFuncGetWorkerFromCache(t *testing.T) { for i := 0; i < AntsSize; i++ { p.Serve(dur) } - time.Sleep(ants.DefaultCleanIntervalTime * time.Second) + time.Sleep(2 * ants.DefaultCleanIntervalTime * time.Second) p.Serve(dur) t.Logf("pool, running workers number:%d", p.Running()) mem := runtime.MemStats{}