summaryrefslogtreecommitdiff
path: root/pool_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-01-28 15:31:53 +0300
committerWolfy-J <[email protected]>2018-01-28 15:31:53 +0300
commita5a62eeb19e67cbeced09729757cbfdf2cde8821 (patch)
tree77a433fec65f3067cc083e06bb3079a05761c84e /pool_test.go
parent68f318b14987e5602d2a4f81f13d7c2c15afc56b (diff)
job error
Diffstat (limited to 'pool_test.go')
-rw-r--r--pool_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pool_test.go b/pool_test.go
index 153ce0f9..76dc233e 100644
--- a/pool_test.go
+++ b/pool_test.go
@@ -137,6 +137,25 @@ func Test_Pool_JobError(t *testing.T) {
assert.Equal(t, "hello", err.Error())
}
+func Test_Pool_Broken_Replace(t *testing.T) {
+ p, err := NewPool(
+ func() *exec.Cmd { return exec.Command("php", "tests/client.php", "broken", "pipes") },
+ NewPipeFactory(),
+ cfg,
+ )
+ defer p.Destroy()
+
+ assert.NotNil(t, p)
+ assert.NoError(t, err)
+
+ res, err := p.Exec(&Payload{Body: []byte("hello")})
+
+ assert.Error(t, err)
+ assert.Nil(t, res)
+
+ // todo: handle error in even log
+}
+
func Test_Pool_AllocateTimeout(t *testing.T) {
p, err := NewPool(
func() *exec.Cmd { return exec.Command("php", "tests/client.php", "delay", "pipes") },