diff options
author | Valery Piashchynski <[email protected]> | 2021-12-26 01:02:46 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-26 01:02:46 +0300 |
commit | 7b5d220f0f1be155d83d887cd4996bdf4394c570 (patch) | |
tree | 129d9d1fd1d2803712fa4b0f05d5cfbf466d10e3 /transport/pipe/pipe_factory_spawn_test.go | |
parent | 9cbb6be27ca0bd56eaa6db9a875830a8ce6110e8 (diff) | |
parent | b27b2a1c9030f38e729e6e2d411379047c28402e (diff) |
[#881]: feat(logger): implement common loggerv2.7.0-beta.1
Diffstat (limited to 'transport/pipe/pipe_factory_spawn_test.go')
-rw-r--r-- | transport/pipe/pipe_factory_spawn_test.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/transport/pipe/pipe_factory_spawn_test.go b/transport/pipe/pipe_factory_spawn_test.go index 7e04f113..9aa12564 100644 --- a/transport/pipe/pipe_factory_spawn_test.go +++ b/transport/pipe/pipe_factory_spawn_test.go @@ -2,13 +2,11 @@ package pipe import ( "os/exec" - "strings" "sync" "testing" "time" "github.com/spiral/errors" - "github.com/spiral/roadrunner/v2/events" "github.com/spiral/roadrunner/v2/payload" "github.com/spiral/roadrunner/v2/worker" "github.com/stretchr/testify/assert" @@ -106,21 +104,9 @@ func Test_Pipe_PipeError4(t *testing.T) { func Test_Pipe_Failboot2(t *testing.T) { cmd := exec.Command("php", "../../tests/failboot.php") - - eb, id := events.Bus() - defer eb.Unsubscribe(id) - ch := make(chan events.Event, 10) - err := eb.SubscribeP(id, "worker.EventWorkerStderr", ch) - require.NoError(t, err) - w, err := NewPipeFactory().SpawnWorker(cmd) - assert.Nil(t, w) assert.Error(t, err) - ev := <-ch - if !strings.Contains(ev.Message(), "failboot") { - t.Fatal("should contain failboot string") - } } func Test_Pipe_Invalid2(t *testing.T) { @@ -364,29 +350,17 @@ func Test_Echo_Slow2(t *testing.T) { func Test_Broken2(t *testing.T) { cmd := exec.Command("php", "../../tests/client.php", "broken", "pipes") - eb, id := events.Bus() - defer eb.Unsubscribe(id) - ch := make(chan events.Event, 10) - err := eb.SubscribeP(id, "worker.EventWorkerStderr", ch) - require.NoError(t, err) - w, err := NewPipeFactory().SpawnWorker(cmd) if err != nil { t.Fatal(err) } sw := worker.From(w) - res, err := sw.Exec(&payload.Payload{Body: []byte("hello")}) assert.NotNil(t, err) assert.Nil(t, res) time.Sleep(time.Second * 3) - - msg := <-ch - if strings.ContainsAny(msg.Message(), "undefined_function()") == false { - t.Fail() - } assert.Error(t, w.Stop()) } |