diff --git a/services/graphite/service_test.go b/services/graphite/service_test.go index 2dc48aec09..ca3fe30eac 100644 --- a/services/graphite/service_test.go +++ b/services/graphite/service_test.go @@ -17,7 +17,9 @@ import ( ) func Test_Service_OpenClose(t *testing.T) { - c := Config{BindAddress: ":35422"} + // Let the OS assign a random port since we are only opening and closing the service, + // not actually connecting to it. + c := Config{BindAddress: "127.0.0.1:0"} service := NewTestService(&c) // Closing a closed service is fine. diff --git a/services/opentsdb/service_test.go b/services/opentsdb/service_test.go index 2fe8befd8d..a8234553dd 100644 --- a/services/opentsdb/service_test.go +++ b/services/opentsdb/service_test.go @@ -20,7 +20,9 @@ import ( ) func Test_Service_OpenClose(t *testing.T) { - service := NewTestService("db0", "127.0.0.1:45362") + // Let the OS assign a random port since we are only opening and closing the service, + // not actually connecting to it. + service := NewTestService("db0", "127.0.0.1:0") // Closing a closed service is fine. if err := service.Service.Close(); err != nil {