From eef8b51d8ab51ae0e6d5889d0b34b64d2040cc44 Mon Sep 17 00:00:00 2001 From: xingweizheng Date: Thu, 17 Nov 2022 20:04:45 +0800 Subject: [PATCH] fix another TestLoopGC error case by goroutine concurrency --- pkg/gc/gc_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gc/gc_test.go b/pkg/gc/gc_test.go index f93fd94..5a88ee9 100644 --- a/pkg/gc/gc_test.go +++ b/pkg/gc/gc_test.go @@ -138,7 +138,7 @@ func TestLoopGC(t *testing.T) { registerOption.RecycleFunc = f2 err = gc.RegisterGC(registerOption) assert.NilError(t, err) - time.Sleep(2 * time.Second) + time.Sleep(waitToBeCollected * time.Second) d.RLock() opts := d.opts d.RUnlock() -- Gitee