diff options
Diffstat (limited to 'static_pool_test.go')
-rw-r--r-- | static_pool_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/static_pool_test.go b/static_pool_test.go index 102717dd..0259bc33 100644 --- a/static_pool_test.go +++ b/static_pool_test.go @@ -370,6 +370,23 @@ func Test_Static_Pool_Handle_Dead(t *testing.T) { assert.Error(t, err) } +// identical to replace but controlled on worker side +func Test_Static_Pool_Slow_Destory(t *testing.T) { + p, err := NewPool( + func() *exec.Cmd { return exec.Command("php", "tests/slow-destroy.php", "echo", "pipes") }, + NewPipeFactory(), + Config{ + NumWorkers: 5, + AllocateTimeout: time.Second, + DestroyTimeout: time.Second, + }, + ) + p.Destroy() + + assert.NotNil(t, p) + assert.NoError(t, err) +} + func Benchmark_Pool_Allocate(b *testing.B) { p, _ := NewPool( func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, |