Skip to content

Commit

Permalink
Refactor testserver to use ci.PortAllocator
Browse files Browse the repository at this point in the history
  • Loading branch information
angrycub committed Apr 7, 2023
1 parent cea6b65 commit 4baea90
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/internal/testutil/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (

"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/nomad/api/internal/testutil/discover"
"github.com/hashicorp/nomad/ci"
testing "github.com/mitchellh/go-testing-interface"
"github.com/shoenig/test/must"
"github.com/shoenig/test/portal"
"github.com/shoenig/test/wait"
)

Expand Down Expand Up @@ -104,8 +104,7 @@ type ServerConfigCallback func(c *TestServerConfig)
// defaultServerConfig returns a new TestServerConfig struct pre-populated with
// usable config for running as server.
func defaultServerConfig(t testing.T) *TestServerConfig {
grabber := portal.New(t)
ports := grabber.Grab(3)
ports := ci.PortAllocator.Grab(3)

logLevel := "ERROR"
if envLogLevel := os.Getenv("NOMAD_TEST_LOG_LEVEL"); envLogLevel != "" {
Expand Down

0 comments on commit 4baea90

Please sign in to comment.