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