diff options
Diffstat (limited to 'service/metrics/rpc_test.go')
-rw-r--r-- | service/metrics/rpc_test.go | 8 |
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) |