summaryrefslogtreecommitdiff
path: root/static_pool_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-30 16:24:10 +0300
committerValery Piashchynski <[email protected]>2020-11-30 16:24:10 +0300
commitb0432d74abdc2b9484aeb4b2215077348e3be5eb (patch)
treea5c4b13677328f67fe504c238bd285d3c941512c /static_pool_test.go
parentf44faa14e6aaaf596da806dcbde062b7c4fb30ee (diff)
Fix issue in the tests for negative wait group counter
Diffstat (limited to 'static_pool_test.go')
-rwxr-xr-xstatic_pool_test.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/static_pool_test.go b/static_pool_test.go
index 2823cbc4..b29b60ae 100755
--- a/static_pool_test.go
+++ b/static_pool_test.go
@@ -175,7 +175,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
wg.Add(1)
// force test to finish
- tt := time.NewTimer(time.Second * 20)
+ tt := time.NewTimer(time.Second * 30)
go func() {
select {
case <-tt.C:
@@ -185,8 +185,6 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
}
}()
- time.Sleep(time.Second)
-
workers := p.Workers()
for i := 0; i < len(workers); i++ {
workers[i].AddListener(func(event interface{}) {
@@ -194,6 +192,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
if wev.Event == EventWorkerLog {
assert.Contains(t, string(wev.Payload.([]byte)), "undefined_function()")
wg.Done()
+ tt.Stop()
return
}
}
@@ -211,7 +210,6 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
p.Destroy(ctx)
}
-//
func Test_StaticPool_Broken_FromOutside(t *testing.T) {
ctx := context.Background()
p, err := NewPool(