summaryrefslogtreecommitdiff
path: root/pkg/pool/supervisor_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-24 11:05:00 +0300
committerGitHub <[email protected]>2020-12-24 11:05:00 +0300
commit439c93225d7a9ebaf7cbf1010a54594b906f7d54 (patch)
treeadc7d78e28a9512cb1b1ba85cb4f19dec7d1323d /pkg/pool/supervisor_test.go
parent40b6c3169931a3fef62b649db19ff01dc685b7d4 (diff)
parent62ee1770cc233328300438ffd690ea1d8fc747bb (diff)
Merge pull request #462 from spiral/feature/CLIv2.0.0-alpha29
feature/CLI
Diffstat (limited to 'pkg/pool/supervisor_test.go')
-rw-r--r--pkg/pool/supervisor_test.go13
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(),