summaryrefslogtreecommitdiff
path: root/transport/socket
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-10-27 22:42:07 +0300
committerValery Piashchynski <[email protected]>2021-10-27 22:42:07 +0300
commit52a6b1b2fc3eaf3cda5594825f3c5a9ae8a9452b (patch)
tree296d48dab1d5396313c061fbfc930a97af0df9f4 /transport/socket
parent15e6f474ef1340f4e93f213bab1cb9548e51a1e8 (diff)
Make sure events bus properly closed
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'transport/socket')
-rw-r--r--transport/socket/socket_factory_spawn_test.go4
-rwxr-xr-xtransport/socket/socket_factory_test.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/transport/socket/socket_factory_spawn_test.go b/transport/socket/socket_factory_spawn_test.go
index 45fb3bd5..2db2fd40 100644
--- a/transport/socket/socket_factory_spawn_test.go
+++ b/transport/socket/socket_factory_spawn_test.go
@@ -112,6 +112,7 @@ 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)
@@ -162,6 +163,7 @@ 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)
@@ -271,6 +273,7 @@ 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)
@@ -327,6 +330,7 @@ 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)
diff --git a/transport/socket/socket_factory_test.go b/transport/socket/socket_factory_test.go
index 11b34999..7b28a847 100755
--- a/transport/socket/socket_factory_test.go
+++ b/transport/socket/socket_factory_test.go
@@ -126,6 +126,7 @@ 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)
@@ -203,6 +204,7 @@ 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)
@@ -366,6 +368,7 @@ 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)
@@ -440,6 +443,7 @@ 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)