Merge pull request #7650 from hashicorp/deflake-set-server-tests
tests: deflake some SetServer related tests
This commit is contained in:
commit
c3ac0ecf7a
|
@ -421,15 +421,20 @@ func (a *Agent) finalizeClientConfig(c *clientconfig.Config) error {
|
|||
// configured explicitly. This handles both running server and client on one
|
||||
// host and -dev mode.
|
||||
if a.server != nil {
|
||||
if a.config.AdvertiseAddrs == nil || a.config.AdvertiseAddrs.RPC == "" {
|
||||
advertised := a.config.AdvertiseAddrs
|
||||
normalized := a.config.normalizedAddrs
|
||||
|
||||
if advertised == nil || advertised.RPC == "" {
|
||||
return fmt.Errorf("AdvertiseAddrs is nil or empty")
|
||||
} else if a.config.normalizedAddrs == nil || a.config.normalizedAddrs.RPC == "" {
|
||||
} else if normalized == nil || normalized.RPC == "" {
|
||||
return fmt.Errorf("normalizedAddrs is nil or empty")
|
||||
}
|
||||
|
||||
c.Servers = append(c.Servers,
|
||||
a.config.normalizedAddrs.RPC,
|
||||
a.config.AdvertiseAddrs.RPC)
|
||||
if normalized.RPC == advertised.RPC {
|
||||
c.Servers = append(c.Servers, normalized.RPC)
|
||||
} else {
|
||||
c.Servers = append(c.Servers, normalized.RPC, advertised.RPC)
|
||||
}
|
||||
}
|
||||
|
||||
// Setup the plugin loaders
|
||||
|
|
|
@ -711,7 +711,7 @@ func TestHTTP_AgentSetServers(t *testing.T) {
|
|||
}
|
||||
defer conn.Close()
|
||||
|
||||
// Write the Consul RPC byte to set the mode
|
||||
// Write the Nomad RPC byte to set the mode
|
||||
if _, err := conn.Write([]byte{byte(pool.RpcNomad)}); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue