Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix TestAgent.Start() to not segfault if the DNSServer cannot L…
…istenAndServe (hashicorp#6409) The embedded `Server` field on a `DNSServer` is only set inside of the `ListenAndServe` method. If that method fails for reasons like the address being in use and is not bindable, then the `Server` field will not be set and the overall `Agent.Start()` will fail. This will trigger the inner loop of `TestAgent.Start()` to invoke `ShutdownEndpoints` which will attempt to pretty print the DNS servers using fields on that inner `Server` field. Because it was never set, this causes a nil pointer dereference and crashes the test.
- Loading branch information