mirror of
https://github.com/coredns/coredns.git
synced 2026-07-13 11:10:10 -04:00
Several tests slept a fixed duration then took a single snapshot of an async result, racing whatever they waited on: - forward health tests waited 20ms for the health-check goroutine to bump an atomic counter, - the auto plugin tests (dns + metrics) waited 50-110ms for a file-watch reload to be picked up, - the file ZoneReload test waited 30ms (self-described as could still be racy) for a reload, - the overloaded health test slept 1s for its background goroutine to fire its first request. Replace each with a bounded poll of the actual condition (the atomic counter, a dns.Exchange response, a metrics scrape, z.ApexIfDefined, or a channel signalled by the test's own handler) so they pass as soon as the awaited state is reached and no longer flake when it is slower than the fixed wait. Test-only. Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
12 KiB
12 KiB