summaryrefslogtreecommitdiff
path: root/pool
diff options
context:
space:
mode:
Diffstat (limited to 'pool')
-rwxr-xr-xpool/static_pool_test.go44
-rw-r--r--pool/supervisor_test.go18
2 files changed, 31 insertions, 31 deletions
diff --git a/pool/static_pool_test.go b/pool/static_pool_test.go
index 29b0fc56..9861f0d8 100755
--- a/pool/static_pool_test.go
+++ b/pool/static_pool_test.go
@@ -30,7 +30,7 @@ func Test_NewPool(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
cfg,
)
@@ -44,7 +44,7 @@ func Test_NewPool(t *testing.T) {
func Test_StaticPool_Invalid(t *testing.T) {
p, err := Initialize(
context.Background(),
- func() *exec.Cmd { return exec.Command("php", "../../tests/invalid.php") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/invalid.php") },
pipe.NewPipeFactory(),
cfg,
)
@@ -56,7 +56,7 @@ func Test_StaticPool_Invalid(t *testing.T) {
func Test_ConfigNoErrorInitDefaults(t *testing.T) {
p, err := Initialize(
context.Background(),
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
&Config{
AllocateTimeout: time.Second,
@@ -72,7 +72,7 @@ func Test_StaticPool_Echo(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
cfg,
)
@@ -96,7 +96,7 @@ func Test_StaticPool_Echo_NilContext(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
cfg,
)
@@ -120,7 +120,7 @@ func Test_StaticPool_Echo_Context(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "head", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "head", "pipes") },
pipe.NewPipeFactory(),
cfg,
)
@@ -144,7 +144,7 @@ func Test_StaticPool_JobError(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "error", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "error", "pipes") },
pipe.NewPipeFactory(),
cfg,
)
@@ -183,7 +183,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "broken", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "broken", "pipes") },
pipe.NewPipeFactory(),
cfg,
AddListeners(listener),
@@ -221,7 +221,7 @@ func Test_StaticPool_Broken_FromOutside(t *testing.T) {
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
cfg2,
AddListeners(listener),
@@ -261,7 +261,7 @@ func Test_StaticPool_Broken_FromOutside(t *testing.T) {
func Test_StaticPool_AllocateTimeout(t *testing.T) {
p, err := Initialize(
context.Background(),
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "delay", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "delay", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 1,
@@ -280,7 +280,7 @@ func Test_StaticPool_Replace_Worker(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "pid", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "pid", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 1,
@@ -319,7 +319,7 @@ func Test_StaticPool_Debug_Worker(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "pid", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "pid", "pipes") },
pipe.NewPipeFactory(),
&Config{
Debug: true,
@@ -361,7 +361,7 @@ func Test_StaticPool_Stop_Worker(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "stop", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "stop", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 1,
@@ -402,7 +402,7 @@ func Test_Static_Pool_Destroy_And_Close(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "delay", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "delay", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 1,
@@ -424,7 +424,7 @@ func Test_Static_Pool_Destroy_And_Close_While_Wait(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "delay", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "delay", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 1,
@@ -454,7 +454,7 @@ func Test_Static_Pool_Handle_Dead(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
context.Background(),
- func() *exec.Cmd { return exec.Command("php", "../../tests/slow-destroy.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/slow-destroy.php", "echo", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 5,
@@ -479,7 +479,7 @@ func Test_Static_Pool_Handle_Dead(t *testing.T) {
func Test_Static_Pool_Slow_Destroy(t *testing.T) {
p, err := Initialize(
context.Background(),
- func() *exec.Cmd { return exec.Command("php", "../../tests/slow-destroy.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/slow-destroy.php", "echo", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 5,
@@ -509,7 +509,7 @@ func Test_StaticPool_NoFreeWorkers(t *testing.T) {
p, err := Initialize(
ctx,
// sleep for the 3 seconds
- func() *exec.Cmd { return exec.Command("php", "../../tests/sleep.php", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/sleep.php", "pipes") },
pipe.NewPipeFactory(),
&Config{
Debug: false,
@@ -541,7 +541,7 @@ func Test_StaticPool_NoFreeWorkers(t *testing.T) {
func Test_Static_Pool_WrongCommand1(t *testing.T) {
p, err := Initialize(
context.Background(),
- func() *exec.Cmd { return exec.Command("phg", "../../tests/slow-destroy.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("phg", "../tests/slow-destroy.php", "echo", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 5,
@@ -593,7 +593,7 @@ func Benchmark_Pool_Echo(b *testing.B) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
cfg,
)
@@ -625,7 +625,7 @@ func Benchmark_Pool_Echo_Batched(b *testing.B) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: uint64(runtime.NumCPU()),
@@ -667,7 +667,7 @@ func Benchmark_Pool_Echo_Replaced(b *testing.B) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/client.php", "echo", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/client.php", "echo", "pipes") },
pipe.NewPipeFactory(),
&Config{
NumWorkers: 1,
diff --git a/pool/supervisor_test.go b/pool/supervisor_test.go
index e76c7ec4..032e220b 100644
--- a/pool/supervisor_test.go
+++ b/pool/supervisor_test.go
@@ -32,7 +32,7 @@ func TestSupervisedPool_Exec(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/memleak.php", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/memleak.php", "pipes") },
pipe.NewPipeFactory(),
cfgSupervised,
)
@@ -66,7 +66,7 @@ func TestSupervisedPool_ExecWithDebugMode(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/supervised.php") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/supervised.php") },
pipe.NewPipeFactory(),
cfgSupervised,
)
@@ -104,7 +104,7 @@ func TestSupervisedPool_ExecTTL_TimedOut(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/sleep.php", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/sleep.php", "pipes") },
pipe.NewPipeFactory(),
cfgExecTTL,
)
@@ -139,7 +139,7 @@ func TestSupervisedPool_ExecTTL_WorkerRestarted(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/sleep-ttl.php") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/sleep-ttl.php") },
pipe.NewPipeFactory(),
cfgExecTTL,
)
@@ -196,7 +196,7 @@ func TestSupervisedPool_Idle(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/idle.php", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/idle.php", "pipes") },
pipe.NewPipeFactory(),
cfgExecTTL,
)
@@ -243,7 +243,7 @@ func TestSupervisedPool_IdleTTL_StateAfterTimeout(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/exec_ttl.php", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/exec_ttl.php", "pipes") },
pipe.NewPipeFactory(),
cfgExecTTL,
)
@@ -286,7 +286,7 @@ func TestSupervisedPool_ExecTTL_OK(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/exec_ttl.php", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/exec_ttl.php", "pipes") },
pipe.NewPipeFactory(),
cfgExecTTL,
)
@@ -341,7 +341,7 @@ func TestSupervisedPool_MaxMemoryReached(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/memleak.php", "pipes") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/memleak.php", "pipes") },
pipe.NewPipeFactory(),
cfgExecTTL,
AddListeners(listener),
@@ -377,7 +377,7 @@ func TestSupervisedPool_AllocateFailedOK(t *testing.T) {
ctx := context.Background()
p, err := Initialize(
ctx,
- func() *exec.Cmd { return exec.Command("php", "../../tests/allocate-failed.php") },
+ func() *exec.Cmd { return exec.Command("php", "../tests/allocate-failed.php") },
pipe.NewPipeFactory(),
cfgExecTTL,
)