mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
fix(forward): deflake TestFailover (#7558)
In CI, the first two upstream attempts can stall on UDP and each consume the default 2s read timeout. Possibly exhausting most of the 5s forward deadline before the healthy third upstream is tried. Lower the read timeout to make retries faster. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/coredns/caddy"
|
||||
"github.com/coredns/coredns/core/dnsserver"
|
||||
@@ -483,6 +484,12 @@ func TestFailover(t *testing.T) {
|
||||
f.OnStartup()
|
||||
defer f.OnShutdown()
|
||||
|
||||
// Reduce per-upstream read timeout to make the test fit within the
|
||||
// per-query deadline defaultTimeout of 5 seconds.
|
||||
for _, p := range f.proxies {
|
||||
p.SetReadTimeout(500 * time.Millisecond)
|
||||
}
|
||||
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion("example.org.", dns.TypeA)
|
||||
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
|
||||
Reference in New Issue
Block a user