diff options
Diffstat (limited to 'transport/socket/socket_factory_test.go')
-rwxr-xr-x | transport/socket/socket_factory_test.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/transport/socket/socket_factory_test.go b/transport/socket/socket_factory_test.go index 10885bac..5a078be4 100755 --- a/transport/socket/socket_factory_test.go +++ b/transport/socket/socket_factory_test.go @@ -4,12 +4,10 @@ import ( "context" "net" "os/exec" - "strings" "sync" "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" @@ -128,20 +126,9 @@ func Test_Tcp_Failboot(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).SpawnWorkerWithTimeout(ctx, 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_Timeout(t *testing.T) { @@ -206,12 +193,6 @@ func Test_Tcp_Broken(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.Second*10).SpawnWorkerWithTimeout(ctx, cmd) if err != nil { t.Fatal(err) @@ -230,11 +211,6 @@ func Test_Tcp_Broken(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 @@ -368,20 +344,9 @@ func Test_Unix_Failboot(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).SpawnWorkerWithTimeout(ctx, 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_Timeout(t *testing.T) { @@ -442,13 +407,6 @@ func Test_Unix_Broken(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).SpawnWorkerWithTimeout(ctx, cmd) if err != nil { t.Fatal(err) @@ -467,11 +425,6 @@ func Test_Unix_Broken(t *testing.T) { assert.Error(t, err) assert.Nil(t, res) - 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) |