diff options
author | Valery Piashchynski <[email protected]> | 2021-08-11 11:45:24 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-11 11:45:24 +0300 |
commit | 3e2e9fbd9650c44d57a41a9dc702fe93aad2b77f (patch) | |
tree | 38f25c3c0679e8510b896d001d1b7dccf21c4bd8 /tests/plugins/metrics | |
parent | d449d9d5aec1eec6d494064299feb1551f88ffe2 (diff) |
Replace all 'localhost' with '127.0.0.1'. Fix default configuration and
other small bugs.
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins/metrics')
-rw-r--r-- | tests/plugins/metrics/configs/.rr-http-metrics.yaml | 2 | ||||
-rw-r--r-- | tests/plugins/metrics/configs/.rr-test.yaml | 4 | ||||
-rw-r--r-- | tests/plugins/metrics/metrics_test.go | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/plugins/metrics/configs/.rr-http-metrics.yaml b/tests/plugins/metrics/configs/.rr-http-metrics.yaml index 95f131c0..3e92a88c 100644 --- a/tests/plugins/metrics/configs/.rr-http-metrics.yaml +++ b/tests/plugins/metrics/configs/.rr-http-metrics.yaml @@ -13,7 +13,7 @@ http: num_workers: 1 metrics: - address: localhost:2112 + address: 127.0.0.1:2112 logs: mode: development diff --git a/tests/plugins/metrics/configs/.rr-test.yaml b/tests/plugins/metrics/configs/.rr-test.yaml index 4890076f..b5c4e64f 100644 --- a/tests/plugins/metrics/configs/.rr-test.yaml +++ b/tests/plugins/metrics/configs/.rr-test.yaml @@ -3,7 +3,7 @@ rpc: metrics: # prometheus client address (path /metrics added automatically) - address: localhost:2112 + address: 127.0.0.1:2112 collect: app_metric: type: histogram @@ -15,4 +15,4 @@ metrics: help: "Custom application counter." logs: mode: development - level: error
\ No newline at end of file + level: error diff --git a/tests/plugins/metrics/metrics_test.go b/tests/plugins/metrics/metrics_test.go index 3d900fcc..c4ea9f2c 100644 --- a/tests/plugins/metrics/metrics_test.go +++ b/tests/plugins/metrics/metrics_test.go @@ -27,7 +27,7 @@ import ( const dialAddr = "127.0.0.1:6001" const dialNetwork = "tcp" -const getAddr = "http://localhost:2112/metrics" +const getAddr = "http://127.0.0.1:2112/metrics" // get request and return body func get() (string, error) { @@ -130,7 +130,7 @@ func TestMetricsIssue571(t *testing.T) { mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).AnyTimes() mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).AnyTimes() mockLogger.EXPECT().Debug("Started RPC service", "address", "tcp://127.0.0.1:6001", "services", []string{"metrics"}).MinTimes(1) - mockLogger.EXPECT().Debug("200 GET http://localhost:56444/", "remote", gomock.Any(), "elapsed", gomock.Any()).MinTimes(1) + mockLogger.EXPECT().Debug("200 GET http://127.0.0.1:56444/", "remote", gomock.Any(), "elapsed", gomock.Any()).MinTimes(1) mockLogger.EXPECT().Info("declaring new metric", "name", "test", "type", gomock.Any(), "namespace", gomock.Any()).MinTimes(1) mockLogger.EXPECT().Info("metric successfully added", "name", "test", "type", gomock.Any(), "namespace", gomock.Any()).MinTimes(1) mockLogger.EXPECT().Info("metric successfully added", "name", "test", "labels", []string{}, "value", gomock.Any()).MinTimes(1) @@ -209,7 +209,7 @@ func TestMetricsIssue571(t *testing.T) { // get request and return body func issue571Http() (string, error) { - r, err := http.Get("http://localhost:56444") + r, err := http.Get("http://127.0.0.1:56444") if err != nil { return "", err } @@ -229,7 +229,7 @@ func issue571Http() (string, error) { // get request and return body func issue571Metrics() (string, error) { - r, err := http.Get("http://localhost:23557") + r, err := http.Get("http://127.0.0.1:23557") if err != nil { return "", err } @@ -989,7 +989,7 @@ func TestHTTPMetrics(t *testing.T) { mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).AnyTimes() mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).AnyTimes() - mockLogger.EXPECT().Debug("200 GET http://localhost:13223/", "remote", gomock.Any(), "elapsed", gomock.Any()).MinTimes(1) + mockLogger.EXPECT().Debug("200 GET http://127.0.0.1:13223/", "remote", gomock.Any(), "elapsed", gomock.Any()).MinTimes(1) err = cont.RegisterAll( cfg, @@ -1056,7 +1056,7 @@ func TestHTTPMetrics(t *testing.T) { } func echoHTTP(t *testing.T) { - req, err := http.NewRequest("GET", "http://localhost:13223", nil) + req, err := http.NewRequest("GET", "http://127.0.0.1:13223", nil) assert.NoError(t, err) r, err := http.DefaultClient.Do(req) |