summaryrefslogtreecommitdiff
path: root/plugins/metrics/tests/plugin2.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/metrics/tests/plugin2.go')
-rw-r--r--plugins/metrics/tests/plugin2.go49
1 files changed, 20 insertions, 29 deletions
diff --git a/plugins/metrics/tests/plugin2.go b/plugins/metrics/tests/plugin2.go
index 4156db6d..4369971b 100644
--- a/plugins/metrics/tests/plugin2.go
+++ b/plugins/metrics/tests/plugin2.go
@@ -1,14 +1,5 @@
package tests
-import (
- "net"
- "net/rpc"
- "time"
-
- "github.com/spiral/errors"
- "github.com/spiral/goridge/v2"
-)
-
// plugin2 makes a call to the plugin1 via RPC
// this is just a simulation of external call FOR TEST
// you don't need to do such things :)
@@ -23,26 +14,26 @@ func (p2 *Plugin2) Serve() chan error {
errCh := make(chan error, 1)
go func() {
- time.Sleep(time.Second * 3)
-
- conn, err := net.Dial("tcp", "127.0.0.1:7001")
- if err != nil {
- errCh <- errors.E(errors.Serve, err)
- return
- }
- client := rpc.NewClientWithCodec(goridge.NewClientCodec(conn))
- var ret string
- err = client.Call("metrics_test.plugin1.Hello", "Valery", &ret)
- if err != nil {
- errCh <- err
- return
- }
- if ret != "Hello, username: Valery" {
- errCh <- errors.E("wrong response")
- return
- }
- // to stop exec
- errCh <- errors.E(errors.Disabled)
+ //time.Sleep(time.Second * 3)
+ //
+ //conn, err := net.Dial("tcp", "127.0.0.1:6001")
+ //if err != nil {
+ // errCh <- errors.E(errors.Serve, err)
+ // return
+ //}
+ //client := rpc.NewClientWithCodec(goridge.NewClientCodec(conn))
+ //var ret string
+ //err = client.Call("metrics_test.plugin1.Hello", "Valery", &ret)
+ //if err != nil {
+ // errCh <- err
+ // return
+ //}
+ //if ret != "Hello, username: Valery" {
+ // errCh <- errors.E("wrong response")
+ // return
+ //}
+ //// to stop exec
+ //errCh <- errors.E(errors.Disabled)
return
}()