The internal health-signal path used to broadcast GOAWAY/health codes to connected Healthz clients is largely untested:
server.MonitorHealthChan (server.go:779) — 0% coverage
server.notifyHealth (server.go:768) — 40% coverage
These functions implement the K8s-aware health broadcast feature (fan-out of HealthStatus_Code to all registered client notifiers, and single-notifier-per-client registration/replacement). The fan-out and notifier-replacement logic currently has no direct unit test.
Scope
Add table/unit tests covering:
notifyHealth registers a receiver and, when called again for the same client address, closes and replaces the prior receiver.
MonitorHealthChan fans a code out to all registered notifiers and exits cleanly when its receiver channel is closed.
No production behavior change; test-only.
The internal health-signal path used to broadcast GOAWAY/health codes to connected Healthz clients is largely untested:
server.MonitorHealthChan(server.go:779) — 0% coverageserver.notifyHealth(server.go:768) — 40% coverageThese functions implement the K8s-aware health broadcast feature (fan-out of
HealthStatus_Codeto all registered client notifiers, and single-notifier-per-client registration/replacement). The fan-out and notifier-replacement logic currently has no direct unit test.Scope
Add table/unit tests covering:
notifyHealthregisters a receiver and, when called again for the same client address, closes and replaces the prior receiver.MonitorHealthChanfans a code out to all registered notifiers and exits cleanly when its receiver channel is closed.No production behavior change; test-only.