diff options
author | Valery Piashchynski <[email protected]> | 2021-12-26 00:50:30 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-12-26 00:50:30 +0300 |
commit | b27b2a1c9030f38e729e6e2d411379047c28402e (patch) | |
tree | 129d9d1fd1d2803712fa4b0f05d5cfbf466d10e3 /transport/socket/socket_factory_spawn_test.go | |
parent | 9cbb6be27ca0bd56eaa6db9a875830a8ce6110e8 (diff) |
implement common logger
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'transport/socket/socket_factory_spawn_test.go')
-rw-r--r-- | transport/socket/socket_factory_spawn_test.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/transport/socket/socket_factory_spawn_test.go b/transport/socket/socket_factory_spawn_test.go index fd852080..7fc6f4a5 100644 --- a/transport/socket/socket_factory_spawn_test.go +++ b/transport/socket/socket_factory_spawn_test.go @@ -3,13 +3,11 @@ package socket import ( "net" "os/exec" - "strings" "sync" "syscall" "testing" "time" - "github.com/spiral/roadrunner/v2/events" "github.com/spiral/roadrunner/v2/payload" "github.com/spiral/roadrunner/v2/worker" "github.com/stretchr/testify/assert" @@ -114,20 +112,9 @@ func Test_Tcp_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, err2 := NewSocketServer(ls, time.Second*5).SpawnWorker(cmd) assert.Nil(t, w) assert.Error(t, err2) - - ev := <-ch - if !strings.Contains(ev.Message(), "failboot") { - t.Fatal("should contain failboot string") - } } func Test_Tcp_Invalid2(t *testing.T) { @@ -165,12 +152,6 @@ func Test_Tcp_Broken2(t *testing.T) { cmd := exec.Command("php", "../../tests/client.php", "broken", "tcp") - 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 := NewSocketServer(ls, time.Minute).SpawnWorker(cmd) if err != nil { t.Fatal(err) @@ -189,11 +170,6 @@ func Test_Tcp_Broken2(t *testing.T) { assert.Nil(t, res) wg.Wait() - ev := <-ch - if !strings.Contains(ev.Message(), "undefined_function()") { - t.Fatal("should contain undefined_function() string") - } - time.Sleep(time.Second) err2 := w.Stop() // write tcp 127.0.0.1:9007->127.0.0.1:34204: use of closed network connection @@ -273,20 +249,9 @@ func Test_Unix_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 := NewSocketServer(ls, time.Second*5).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_Unix_Timeout2(t *testing.T) { @@ -330,12 +295,6 @@ func Test_Unix_Broken2(t *testing.T) { cmd := exec.Command("php", "../../tests/client.php", "broken", "unix") - 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 := NewSocketServer(ls, time.Minute).SpawnWorker(cmd) if err != nil { t.Fatal(err) @@ -355,11 +314,6 @@ func Test_Unix_Broken2(t *testing.T) { assert.Nil(t, res) wg.Wait() - ev := <-ch - if !strings.Contains(ev.Message(), "undefined_function()") { - t.Fatal("should contain undefined_function string") - } - time.Sleep(time.Second) err = w.Stop() assert.NoError(t, err) |