summaryrefslogtreecommitdiff
path: root/tests/plugins/informer
diff options
context:
space:
mode:
Diffstat (limited to 'tests/plugins/informer')
-rw-r--r--tests/plugins/informer/informer_test.go4
-rw-r--r--tests/plugins/informer/test_plugin.go16
2 files changed, 15 insertions, 5 deletions
diff --git a/tests/plugins/informer/informer_test.go b/tests/plugins/informer/informer_test.go
index 31e14ff4..b6f50fd5 100644
--- a/tests/plugins/informer/informer_test.go
+++ b/tests/plugins/informer/informer_test.go
@@ -12,12 +12,12 @@ import (
endure "github.com/spiral/endure/pkg/container"
goridgeRpc "github.com/spiral/goridge/v3/pkg/rpc"
+ "github.com/spiral/roadrunner/v2/pkg/process"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/informer"
"github.com/spiral/roadrunner/v2/plugins/logger"
rpcPlugin "github.com/spiral/roadrunner/v2/plugins/rpc"
"github.com/spiral/roadrunner/v2/plugins/server"
- "github.com/spiral/roadrunner/v2/tools"
"github.com/stretchr/testify/assert"
)
@@ -100,7 +100,7 @@ func informerWorkersRPCTest(t *testing.T) {
// WorkerList contains list of workers.
list := struct {
// Workers is list of workers.
- Workers []tools.ProcessState `json:"workers"`
+ Workers []process.State `json:"workers"`
}{}
err = client.Call("informer.Workers", "informer.plugin1", &list)
diff --git a/tests/plugins/informer/test_plugin.go b/tests/plugins/informer/test_plugin.go
index 8a1fb933..0c9065a3 100644
--- a/tests/plugins/informer/test_plugin.go
+++ b/tests/plugins/informer/test_plugin.go
@@ -5,7 +5,7 @@ import (
"time"
"github.com/spiral/roadrunner/v2/pkg/pool"
- "github.com/spiral/roadrunner/v2/pkg/worker"
+ "github.com/spiral/roadrunner/v2/pkg/process"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/server"
)
@@ -49,11 +49,21 @@ func (p1 *Plugin1) Name() string {
return "informer.plugin1"
}
-func (p1 *Plugin1) Workers() []worker.BaseProcess {
+func (p1 *Plugin1) Workers() []process.State {
p, err := p1.server.NewWorkerPool(context.Background(), testPoolConfig, nil)
if err != nil {
panic(err)
}
- return p.Workers()
+ ps := make([]process.State, 0, len(p.Workers()))
+ workers := p.Workers()
+ for i := 0; i < len(workers); i++ {
+ state, err := process.WorkerProcessState(workers[i])
+ if err != nil {
+ return nil
+ }
+ ps = append(ps, state)
+ }
+
+ return ps
}