Commit 5c104943 authored by Jason Yellick's avatar Jason Yellick
Browse files

FAB-10344 Make metrics tests use ephemeral ports



The ports used by the metrics test (such as 8081 and 8025) are sometimes
bound by other services.  Since the tests never actually connects to the
service, there's no requirement that these ports be specified, only that
they be different, so ephemeral ports are the better choice.

Change-Id: I52f9ddaac0435c50e49dccf64309a132ae933fb7
Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
parent 342fa4bc
......@@ -25,7 +25,7 @@ func TestStartSuccessStatsd(t *testing.T) {
Reporter: statsdReporterType,
Interval: 1 * time.Second,
StatsdReporterOpts: StatsdReporterOpts{
Address: "127.0.0.1:8125",
Address: "127.0.0.1:0",
FlushInterval: 2 * time.Second,
FlushBytes: 512,
}}
......@@ -43,7 +43,7 @@ func TestStartSuccessProm(t *testing.T) {
Reporter: promReporterType,
Interval: 1 * time.Second,
PromReporterOpts: PromReporterOpts{
ListenAddress: "127.0.0.1:8081",
ListenAddress: "127.0.0.1:0",
}}
s, err := create(opts)
go s.Start()
......@@ -99,7 +99,7 @@ func TestStartStatsdInvalidFlushInterval(t *testing.T) {
Interval: 1 * time.Second,
Reporter: statsdReporterType,
StatsdReporterOpts: StatsdReporterOpts{
Address: "127.0.0.1:8125",
Address: "127.0.0.1:0",
FlushInterval: 0,
FlushBytes: 512,
},
......@@ -131,7 +131,7 @@ func TestStartStatsdInvalidFlushBytes(t *testing.T) {
Interval: 1 * time.Second,
Reporter: statsdReporterType,
StatsdReporterOpts: StatsdReporterOpts{
Address: "127.0.0.1:8125",
Address: "127.0.0.1:0",
FlushInterval: 2 * time.Second,
FlushBytes: 0,
},
......@@ -162,7 +162,7 @@ func TestStartAndClose(t *testing.T) {
Reporter: statsdReporterType,
Interval: 1 * time.Second,
StatsdReporterOpts: StatsdReporterOpts{
Address: "127.0.0.1:8125",
Address: "127.0.0.1:0",
FlushInterval: 2 * time.Second,
FlushBytes: 512,
}}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment