mirror of
https://github.com/coredns/coredns.git
synced 2026-10-27 20:55:45 -04:00
plugin/forward: add startup health checks with start_failed (#8663)
* plugin/forward: add startup health checks with start_failed Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com> * test: separate CoreDNS and third-party imports Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com> --------- Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com>
This commit is contained in:
@@ -521,6 +521,7 @@ func TestDoQHealthCheck(t *testing.T) {
|
||||
})
|
||||
|
||||
p := NewProxy("TestDoQHealth", server.addr(), transport.QUIC)
|
||||
p.initiallyDown.Store(true)
|
||||
p.SetTLSConfig(clientTLS)
|
||||
defer p.Stop()
|
||||
hc := p.GetHealthchecker()
|
||||
@@ -529,6 +530,9 @@ func TestDoQHealthCheck(t *testing.T) {
|
||||
if err := hc.Check(p); err != nil {
|
||||
t.Fatalf("health check failed: %v", err)
|
||||
}
|
||||
if p.Down(2) {
|
||||
t.Error("successful QUIC health check did not clear startup failure")
|
||||
}
|
||||
msg := <-query
|
||||
if len(msg.Question) != 1 || msg.Question[0].Name != "health.example." || msg.Question[0].Qtype != dns.TypeNS {
|
||||
t.Fatalf("unexpected health query: %v", msg.Question)
|
||||
|
||||
Reference in New Issue
Block a user