diff options
-rw-r--r-- | plugins/checker/plugin.go | 2 | ||||
-rwxr-xr-x | sync_worker_test.go | 17 |
2 files changed, 6 insertions, 13 deletions
diff --git a/plugins/checker/plugin.go b/plugins/checker/plugin.go index 11dce06e..9f4c1fd8 100644 --- a/plugins/checker/plugin.go +++ b/plugins/checker/plugin.go @@ -93,7 +93,7 @@ func (c *Plugin) RPC() interface{} { } type Plugins struct { - Plugins []string `query:"service"` + Plugins []string `query:"plugin"` } const template string = "Service: %s: Status: %d\n" diff --git a/sync_worker_test.go b/sync_worker_test.go index 9786d709..890a2365 100755 --- a/sync_worker_test.go +++ b/sync_worker_test.go @@ -3,8 +3,8 @@ package roadrunner import ( "context" "os/exec" + "sync" "testing" - "time" "github.com/spiral/errors" "github.com/stretchr/testify/assert" @@ -159,20 +159,13 @@ func Test_Broken(t *testing.T) { if err != nil { t.Fatal(err) } - ch := make(chan struct{}) - go func() { - tt := time.NewTimer(time.Second * 10) - select { - case <-tt.C: - tt.Stop() - ch <- struct{}{} - } - }() + wg := &sync.WaitGroup{} + wg.Add(1) w.AddListener(func(event interface{}) { assert.Contains(t, string(event.(WorkerEvent).Payload.([]byte)), "undefined_function()") - ch <- struct{}{} + wg.Done() }) syncWorker, err := NewSyncWorker(w) @@ -185,7 +178,7 @@ func Test_Broken(t *testing.T) { assert.Nil(t, res.Body) assert.Nil(t, res.Context) - <-ch + wg.Wait() assert.Error(t, w.Stop(ctx)) } |