summaryrefslogtreecommitdiff
path: root/static_pool_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-05-29 13:03:34 +0300
committerWolfy-J <[email protected]>2018-05-29 13:03:34 +0300
commitb8bc792b263a3891e125757a35cc563bb85f1a0b (patch)
treef7a9e6f2568220491a26f6544e4acf0ed62012bb /static_pool_test.go
parent50f820833eeef8518b3b978b33c6f20391225162 (diff)
nested observers
Diffstat (limited to 'static_pool_test.go')
-rw-r--r--static_pool_test.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/static_pool_test.go b/static_pool_test.go
index b4069b98..a1db7c8c 100644
--- a/static_pool_test.go
+++ b/static_pool_test.go
@@ -19,7 +19,7 @@ var cfg = Config{
func Test_NewPool(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -33,7 +33,7 @@ func Test_NewPool(t *testing.T) {
func Test_StaticPool_Invalid(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/invalid.php") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/invalid.php") },
NewPipeFactory(),
cfg,
)
@@ -44,7 +44,7 @@ func Test_StaticPool_Invalid(t *testing.T) {
func Test_ConfigError(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
Config{
AllocateTimeout: time.Second,
@@ -58,7 +58,7 @@ func Test_ConfigError(t *testing.T) {
func Test_StaticPool_Echo(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -79,7 +79,7 @@ func Test_StaticPool_Echo(t *testing.T) {
func Test_StaticPool_Echo_NilContext(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -100,7 +100,7 @@ func Test_StaticPool_Echo_NilContext(t *testing.T) {
func Test_StaticPool_Echo_Context(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "head", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "head", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -121,7 +121,7 @@ func Test_StaticPool_Echo_Context(t *testing.T) {
func Test_StaticPool_JobError(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "error", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "error", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -141,7 +141,7 @@ func Test_StaticPool_JobError(t *testing.T) {
func Test_StaticPool_Broken_Replace(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "broken", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "broken", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -150,7 +150,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
assert.NotNil(t, p)
assert.NoError(t, err)
- p.Report(func(e int, w *Worker, ctx interface{}) {
+ p.Observe(func(e int, w *Worker, ctx interface{}) {
if err, ok := ctx.(error); ok {
assert.Contains(t, err.Error(), "undefined_function()")
}
@@ -164,7 +164,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
func Test_StaticPool_AllocateTimeout(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "delay", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "delay", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,
@@ -196,7 +196,7 @@ func Test_StaticPool_AllocateTimeout(t *testing.T) {
func Test_StaticPool_Replace_Worker(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "pid", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "pid", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,
@@ -232,7 +232,7 @@ func Test_StaticPool_Replace_Worker(t *testing.T) {
// identical to replace but controlled on worker side
func Test_StaticPool_Stop_Worker(t *testing.T) {
p, err := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "stop", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "stop", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,
@@ -266,7 +266,7 @@ func Test_StaticPool_Stop_Worker(t *testing.T) {
func Benchmark_Pool_Allocate(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -285,7 +285,7 @@ func Benchmark_Pool_Allocate(b *testing.B) {
func Benchmark_Pool_Echo(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -300,7 +300,7 @@ func Benchmark_Pool_Echo(b *testing.B) {
func Benchmark_Pool_Echo_Batched(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
cfg,
)
@@ -323,7 +323,7 @@ func Benchmark_Pool_Echo_Batched(b *testing.B) {
func Benchmark_Pool_Echo_Replaced(b *testing.B) {
p, _ := NewPool(
- func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "php/tests/client.php", "echo", "pipes") },
NewPipeFactory(),
Config{
NumWorkers: 1,