From 30825ef9b4a742f8e7bf7b8caee0bedccb36b601 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 24 Nov 2020 16:44:19 +0300 Subject: force Test_StaticPool_Broken_Replace to finish --- static_pool_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'static_pool_test.go') diff --git a/static_pool_test.go b/static_pool_test.go index f8478e14..cbbae07a 100755 --- a/static_pool_test.go +++ b/static_pool_test.go @@ -174,7 +174,18 @@ func Test_StaticPool_Broken_Replace(t *testing.T) { wg := &sync.WaitGroup{} wg.Add(1) + // force test to finish + tt := time.NewTimer(time.Second * 20) + go func() { + select { + case <-tt.C: + tt.Stop() + wg.Done() + } + }() + time.Sleep(time.Second) + workers := p.Workers() for i := 0; i < len(workers); i++ { workers[i].AddListener(func(event interface{}) { @@ -194,6 +205,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) { assert.Nil(t, res.Body) wg.Wait() + tt.Stop() p.Destroy(ctx) } -- cgit v1.2.3