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:
houyuwushang
2026-10-21 11:34:41 +08:00
committed by GitHub
parent 0fe7b08fbb
commit 3cbe6b5269
8 changed files with 250 additions and 12 deletions

View File

@@ -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)