diff options
Diffstat (limited to 'pkg/pool/supervisor_test.go')
-rw-r--r-- | pkg/pool/supervisor_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pkg/pool/supervisor_test.go b/pkg/pool/supervisor_test.go index 7dd423b8..cb67ebe1 100644 --- a/pkg/pool/supervisor_test.go +++ b/pkg/pool/supervisor_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/spiral/roadrunner/v2" "github.com/spiral/roadrunner/v2/pkg/payload" "github.com/spiral/roadrunner/v2/pkg/pipe" + "github.com/spiral/roadrunner/v2/tools" "github.com/stretchr/testify/assert" ) @@ -27,7 +27,7 @@ var cfgSupervised = Config{ func TestSupervisedPool_Exec(t *testing.T) { ctx := context.Background() - p, err := NewPool( + p, err := Initialize( ctx, func() *exec.Cmd { return exec.Command("php", "../../tests/memleak.php", "pipes") }, pipe.NewPipeFactory(), @@ -47,7 +47,7 @@ func TestSupervisedPool_Exec(t *testing.T) { default: workers := p.Workers() if len(workers) > 0 { - s, err := roadrunner.WorkerProcessState(workers[0]) + s, err := tools.WorkerProcessState(workers[0]) assert.NoError(t, err) assert.NotNil(t, s) // since this is soft limit, double max memory limit watch @@ -85,7 +85,7 @@ func TestSupervisedPool_ExecTTL_TimedOut(t *testing.T) { }, } ctx := context.Background() - p, err := NewPool( + p, err := Initialize( ctx, func() *exec.Cmd { return exec.Command("php", "../../tests/sleep.php", "pipes") }, pipe.NewPipeFactory(), @@ -104,7 +104,8 @@ func TestSupervisedPool_ExecTTL_TimedOut(t *testing.T) { }) assert.Error(t, err) - assert.Empty(t, resp) + assert.Empty(t, resp.Body) + assert.Empty(t, resp.Context) time.Sleep(time.Second * 1) // should be new worker with new pid @@ -125,7 +126,7 @@ func TestSupervisedPool_ExecTTL_OK(t *testing.T) { }, } ctx := context.Background() - p, err := NewPool( + p, err := Initialize( ctx, func() *exec.Cmd { return exec.Command("php", "../../tests/sleep.php", "pipes") }, pipe.NewPipeFactory(), |