summaryrefslogtreecommitdiff
path: root/static_pool_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-23 15:31:52 +0300
committerWolfy-J <[email protected]>2018-09-23 15:31:52 +0300
commit5bdff4aea88a6c74c67abe447cbb47ddd58b7bc7 (patch)
tree031647c71a33303771a0c7701fa17775528955c8 /static_pool_test.go
parentdac0e9cb81cf49cb5967c04eb494709ee3f164d9 (diff)
more coverage
Diffstat (limited to 'static_pool_test.go')
-rw-r--r--static_pool_test.go17
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") },