summaryrefslogtreecommitdiff
path: root/service/metrics
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-06-29 23:58:46 +0300
committerWolfy-J <[email protected]>2019-06-29 23:58:46 +0300
commit297031a523070040cf2de63b409135c5098bc393 (patch)
treeed9e74701012e591f65ddb8b77e2c8c89e3fe21c /service/metrics
parent027289fe31b4ffb63aca525aee253e4a9a6ac805 (diff)
rotate rpc ports for travis
Diffstat (limited to 'service/metrics')
-rw-r--r--service/metrics/rpc_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/service/metrics/rpc_test.go b/service/metrics/rpc_test.go
index 74b067c5..b7702311 100644
--- a/service/metrics/rpc_test.go
+++ b/service/metrics/rpc_test.go
@@ -7,10 +7,13 @@ import (
"github.com/spiral/roadrunner/service/rpc"
"github.com/stretchr/testify/assert"
rpc2 "net/rpc"
+ "strconv"
"testing"
"time"
)
+var port = 5004
+
func setup(t *testing.T, metric string) (*rpc2.Client, service.Container) {
logger, _ := test.NewNullLogger()
logger.SetLevel(logrus.DebugLevel)
@@ -20,7 +23,7 @@ func setup(t *testing.T, metric string) (*rpc2.Client, service.Container) {
c.Register(ID, &Service{})
assert.NoError(t, c.Init(&testCfg{
- rpcCfg: `{"enable":true, "listen":"tcp://:5004"}`,
+ rpcCfg: `{"enable":true, "listen":"tcp://:` + strconv.Itoa(port) + `"}`,
metricsCfg: `{
"address": "localhost:2112",
"collect":{
@@ -28,6 +31,9 @@ func setup(t *testing.T, metric string) (*rpc2.Client, service.Container) {
}
}`}))
+ // rotate ports for travis
+ port++
+
s, _ := c.Get(ID)
assert.NotNil(t, s)