Skip to content

Commit 297031a

Browse files
committed
rotate rpc ports for travis
1 parent 027289f commit 297031a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

service/metrics/rpc_test.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import (
77
"github.com/spiral/roadrunner/service/rpc"
88
"github.com/stretchr/testify/assert"
99
rpc2 "net/rpc"
10+
"strconv"
1011
"testing"
1112
"time"
1213
)
1314

15+
var port = 5004
16+
1417
func setup(t *testing.T, metric string) (*rpc2.Client, service.Container) {
1518
logger, _ := test.NewNullLogger()
1619
logger.SetLevel(logrus.DebugLevel)
@@ -20,14 +23,17 @@ func setup(t *testing.T, metric string) (*rpc2.Client, service.Container) {
2023
c.Register(ID, &Service{})
2124

2225
assert.NoError(t, c.Init(&testCfg{
23-
rpcCfg: `{"enable":true, "listen":"tcp://:5004"}`,
26+
rpcCfg: `{"enable":true, "listen":"tcp://:` + strconv.Itoa(port) + `"}`,
2427
metricsCfg: `{
2528
"address": "localhost:2112",
2629
"collect":{
2730
` + metric + `
2831
}
2932
}`}))
3033

34+
// rotate ports for travis
35+
port++
36+
3137
s, _ := c.Get(ID)
3238
assert.NotNil(t, s)
3339

0 commit comments

Comments
 (0)