diff --git a/agent/agent.go b/agent/agent.go index c3427c3c0a..063b120eb8 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1654,8 +1654,10 @@ func (a *Agent) ShutdownEndpoints() { } for _, srv := range a.dnsServers { - a.logger.Printf("[INFO] agent: Stopping DNS server %s (%s)", srv.Server.Addr, srv.Server.Net) - srv.Shutdown() + if srv.Server != nil { + a.logger.Printf("[INFO] agent: Stopping DNS server %s (%s)", srv.Server.Addr, srv.Server.Net) + srv.Shutdown() + } } a.dnsServers = nil diff --git a/agent/testagent.go b/agent/testagent.go index 648d91957d..fc9c15a6c0 100644 --- a/agent/testagent.go +++ b/agent/testagent.go @@ -165,7 +165,7 @@ func (a *TestAgent) Start(t *testing.T) *TestAgent { a.Agent = agent break } else if i == 0 { - require.Fail("%s %s Error starting agent: %s", id, a.Name, err) + require.Failf("%s %s Error starting agent: %s", id, a.Name, err) } else if a.ExpectConfigError { // Panic the error since this can be caught if needed. Pretty gross way to // detect errors but enough for now and this is a tiny edge case that I'd