diff options
author | Wolfy-J <[email protected]> | 2018-01-28 15:31:53 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-01-28 15:31:53 +0300 |
commit | a5a62eeb19e67cbeced09729757cbfdf2cde8821 (patch) | |
tree | 77a433fec65f3067cc083e06bb3079a05761c84e /pool_test.go | |
parent | 68f318b14987e5602d2a4f81f13d7c2c15afc56b (diff) |
job error
Diffstat (limited to 'pool_test.go')
-rw-r--r-- | pool_test.go | 19 |
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") }, |