mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-21 15:06:38 +02:00
etcd: Use dedicated port for HTTP listener when testing to silent warning.
Follow-up to #475
This commit is contained in:
parent
b0f677dbc4
commit
c11902b2f3
|
@ -81,8 +81,11 @@ func NewEtcdForTest(t *testing.T) *embed.Etcd {
|
|||
u.Host = net.JoinHostPort("localhost", strconv.Itoa(port))
|
||||
cfg.ListenClientUrls = []url.URL{*u}
|
||||
cfg.AdvertiseClientUrls = []url.URL{*u}
|
||||
httpListener := u
|
||||
httpListener.Host = net.JoinHostPort("localhost", strconv.Itoa(port+1))
|
||||
cfg.ListenClientHttpUrls = []url.URL{*httpListener}
|
||||
peerListener := u
|
||||
peerListener.Host = net.JoinHostPort("localhost", strconv.Itoa(port+1))
|
||||
peerListener.Host = net.JoinHostPort("localhost", strconv.Itoa(port+2))
|
||||
cfg.ListenPeerUrls = []url.URL{*peerListener}
|
||||
cfg.AdvertisePeerUrls = []url.URL{*peerListener}
|
||||
cfg.InitialCluster = "default=" + peerListener.String()
|
||||
|
|
|
@ -80,6 +80,9 @@ func newEtcdForTesting(t *testing.T) *embed.Etcd {
|
|||
for port := 50000; port < 50100; port++ {
|
||||
u.Host = net.JoinHostPort("localhost", strconv.Itoa(port))
|
||||
cfg.ListenClientUrls = []url.URL{*u}
|
||||
httpListener := u
|
||||
httpListener.Host = net.JoinHostPort("localhost", strconv.Itoa(port+1))
|
||||
cfg.ListenClientHttpUrls = []url.URL{*httpListener}
|
||||
etcd, err = embed.StartEtcd(cfg)
|
||||
if isErrorAddressAlreadyInUse(err) {
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue