test: use random ports for consul tests
This commit is contained in:
parent
dbe8009968
commit
5a17fabc50
|
@ -2,10 +2,10 @@ package consul
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync/atomic"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -17,10 +17,8 @@ import (
|
||||||
"github.com/hashicorp/go-uuid"
|
"github.com/hashicorp/go-uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
var nextPort int32 = 15000
|
|
||||||
|
|
||||||
func getPort() int {
|
func getPort() int {
|
||||||
return int(atomic.AddInt32(&nextPort, 1))
|
return 1030 + int(rand.Int31n(64400))
|
||||||
}
|
}
|
||||||
|
|
||||||
func configureTLS(config *Config) {
|
func configureTLS(config *Config) {
|
||||||
|
|
Loading…
Reference in a new issue