From b27b2a1c9030f38e729e6e2d411379047c28402e Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Sun, 26 Dec 2021 00:50:30 +0300 Subject: implement common logger Signed-off-by: Valery Piashchynski --- transport/socket/socket_factory_spawn_test.go | 46 --------------------------- 1 file changed, 46 deletions(-) (limited to 'transport/socket/socket_factory_spawn_test.go') 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) -- cgit v1.2.3