Merge pull request #7721 from influxdata/mr-fix-flaky-port-tests
Bind to random port in service open/close testspull/7727/head
commit
eceecf4cfa
|
@ -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.
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue