|
|
@ -23,12 +23,13 @@ import ( |
|
|
|
"testing" |
|
|
|
"testing" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Tests for port availability logic written for server startup sequence.
|
|
|
|
func TestCheckPortAvailability(t *testing.T) { |
|
|
|
func TestCheckPortAvailability(t *testing.T) { |
|
|
|
tests := []struct { |
|
|
|
tests := []struct { |
|
|
|
port int |
|
|
|
port int |
|
|
|
}{ |
|
|
|
}{ |
|
|
|
{9000}, |
|
|
|
{getFreePort()}, |
|
|
|
{10000}, |
|
|
|
{getFreePort()}, |
|
|
|
} |
|
|
|
} |
|
|
|
for _, test := range tests { |
|
|
|
for _, test := range tests { |
|
|
|
// This test should pass if the ports are available
|
|
|
|
// This test should pass if the ports are available
|
|
|
|