mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-08 00:42:25 +02:00
Fix testing etcd server not starting up if etcd is running on host.
This commit is contained in:
parent
af4bd51ec0
commit
a761f135a8
|
@ -80,6 +80,11 @@ func NewEtcdForTest(t *testing.T) *embed.Etcd {
|
||||||
u.Host = net.JoinHostPort("localhost", strconv.Itoa(port))
|
u.Host = net.JoinHostPort("localhost", strconv.Itoa(port))
|
||||||
cfg.LCUrls = []url.URL{*u}
|
cfg.LCUrls = []url.URL{*u}
|
||||||
cfg.ACUrls = []url.URL{*u}
|
cfg.ACUrls = []url.URL{*u}
|
||||||
|
peerListener := u
|
||||||
|
peerListener.Host = net.JoinHostPort("localhost", strconv.Itoa(port+1))
|
||||||
|
cfg.LPUrls = []url.URL{*peerListener}
|
||||||
|
cfg.APUrls = []url.URL{*peerListener}
|
||||||
|
cfg.InitialCluster = "default=" + peerListener.String()
|
||||||
etcd, err = embed.StartEtcd(cfg)
|
etcd, err = embed.StartEtcd(cfg)
|
||||||
if isErrorAddressAlreadyInUse(err) {
|
if isErrorAddressAlreadyInUse(err) {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue