diff options
author | Valery Piashchynski <[email protected]> | 2021-08-18 17:26:42 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-18 17:26:42 +0300 |
commit | 324407b3e2d779143be65872993c4d091abb1d38 (patch) | |
tree | e6f0bd64241ab2d4dc05809128c8e8d7d74cbcc4 /pkg/pool/static_pool_test.go | |
parent | a5435be8ab58bd23f1c2d3afd4484dd1d86b6002 (diff) | |
parent | eb70b89cb2f23ccd44b91bbcac7438a05a40c801 (diff) |
#764: feat(stat): `job` plugin drivers statistic
#764: feat(stat): `job` plugin drivers statistic
Diffstat (limited to 'pkg/pool/static_pool_test.go')
-rwxr-xr-x | pkg/pool/static_pool_test.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/pkg/pool/static_pool_test.go b/pkg/pool/static_pool_test.go index b72b8c32..cb6578a8 100755 --- a/pkg/pool/static_pool_test.go +++ b/pkg/pool/static_pool_test.go @@ -227,9 +227,9 @@ func Test_StaticPool_Broken_FromOutside(t *testing.T) { AddListeners(listener), ) assert.NoError(t, err) - defer p.Destroy(ctx) - assert.NotNil(t, p) + defer p.Destroy(ctx) + time.Sleep(time.Second) res, err := p.Exec(&payload.Payload{Body: []byte("hello")}) @@ -290,10 +290,12 @@ func Test_StaticPool_Replace_Worker(t *testing.T) { }, ) assert.NoError(t, err) - defer p.Destroy(ctx) - assert.NotNil(t, p) + defer p.Destroy(ctx) + // prevent process is not ready + time.Sleep(time.Second) + var lastPID string lastPID = strconv.Itoa(int(p.Workers()[0].Pid())) @@ -326,10 +328,12 @@ func Test_StaticPool_Debug_Worker(t *testing.T) { }, ) assert.NoError(t, err) - defer p.Destroy(ctx) - assert.NotNil(t, p) + defer p.Destroy(ctx) + + // prevent process is not ready + time.Sleep(time.Second) assert.Len(t, p.Workers(), 0) var lastPID string @@ -366,10 +370,11 @@ func Test_StaticPool_Stop_Worker(t *testing.T) { }, ) assert.NoError(t, err) - defer p.Destroy(ctx) - assert.NotNil(t, p) + defer p.Destroy(ctx) + time.Sleep(time.Second) + var lastPID string lastPID = strconv.Itoa(int(p.Workers()[0].Pid())) @@ -460,6 +465,7 @@ func Test_Static_Pool_Handle_Dead(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, p) + time.Sleep(time.Second) for i := range p.Workers() { p.Workers()[i].State().Set(worker.StateErrored) } |