summaryrefslogtreecommitdiff
path: root/service/metrics/service_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-09-06 13:12:52 +0300
committerWolfy-J <[email protected]>2019-09-06 13:12:52 +0300
commit1d6b7c125c2d07c3ef646e9a90f3ebb422fa44df (patch)
tree44c06ab0e7e97c77b7c864b82e8d2ac96f906f8a /service/metrics/service_test.go
parent461db7f19195f70306e41e8920616c53eb00c1f3 (diff)
improving stability of travis tests due to slow tcp port release
Diffstat (limited to 'service/metrics/service_test.go')
-rw-r--r--service/metrics/service_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/service/metrics/service_test.go b/service/metrics/service_test.go
index c7d08fa9..0cf6fd95 100644
--- a/service/metrics/service_test.go
+++ b/service/metrics/service_test.go
@@ -57,7 +57,7 @@ func TestService_Serve(t *testing.T) {
c.Register(ID, &Service{})
assert.NoError(t, c.Init(&testCfg{metricsCfg: `{
- "address": "localhost:2112"
+ "address": "localhost:2116"
}`}))
s, _ := c.Get(ID)
@@ -67,7 +67,7 @@ func TestService_Serve(t *testing.T) {
time.Sleep(time.Millisecond * 100)
defer c.Stop()
- out, _, err := get("http://localhost:2112/metrics")
+ out, _, err := get("http://localhost:2116/metrics")
assert.NoError(t, err)
assert.Contains(t, out, "go_gc_duration_seconds")
@@ -81,7 +81,7 @@ func Test_ServiceCustomMetric(t *testing.T) {
c.Register(ID, &Service{})
assert.NoError(t, c.Init(&testCfg{metricsCfg: `{
- "address": "localhost:2112"
+ "address": "localhost:2115"
}`}))
s, _ := c.Get(ID)
@@ -100,7 +100,7 @@ func Test_ServiceCustomMetric(t *testing.T) {
collector.Set(100)
- out, _, err := get("http://localhost:2112/metrics")
+ out, _, err := get("http://localhost:2115/metrics")
assert.NoError(t, err)
assert.Contains(t, out, "my_gauge 100")
@@ -114,7 +114,7 @@ func Test_ServiceCustomMetricMust(t *testing.T) {
c.Register(ID, &Service{})
assert.NoError(t, c.Init(&testCfg{metricsCfg: `{
- "address": "localhost:2112"
+ "address": "localhost:2114"
}`}))
s, _ := c.Get(ID)
@@ -133,7 +133,7 @@ func Test_ServiceCustomMetricMust(t *testing.T) {
collector.Set(100)
- out, _, err := get("http://localhost:2112/metrics")
+ out, _, err := get("http://localhost:2114/metrics")
assert.NoError(t, err)
assert.Contains(t, out, "my_gauge_2 100")
@@ -147,7 +147,7 @@ func Test_ConfiguredMetric(t *testing.T) {
c.Register(ID, &Service{})
assert.NoError(t, c.Init(&testCfg{metricsCfg: `{
- "address": "localhost:2112",
+ "address": "localhost:2113",
"collect":{
"user_gauge":{
"type": "gauge"
@@ -168,7 +168,7 @@ func Test_ConfiguredMetric(t *testing.T) {
assert.Nil(t, s.(*Service).Collector("invalid"))
- out, _, err := get("http://localhost:2112/metrics")
+ out, _, err := get("http://localhost:2113/metrics")
assert.NoError(t, err)
assert.Contains(t, out, "user_gauge 100")