Ограничить дозвон и поиск имени зависимостей одной секундой

This commit is contained in:
2026-10-06 15:54:26 +03:00
parent f9850a36c4
commit bea31f3f02
4 changed files with 33 additions and 10 deletions
+8 -2
View File
@@ -24,8 +24,14 @@ func TestNewClientPingsAndBoundsWaiting(t *testing.T) {
}
defer client.Close()
opts := client.Options()
if opts.DialTimeout != 2*time.Second || opts.ReadTimeout != time.Second || opts.WriteTimeout != time.Second {
t.Fatalf("timeouts = %v/%v/%v, want 2s/1s/1s", opts.DialTimeout, opts.ReadTimeout, opts.WriteTimeout)
if opts.DialTimeout != time.Second || opts.ReadTimeout != time.Second || opts.WriteTimeout != time.Second {
t.Fatalf("timeouts = %v/%v/%v, want 1s each", opts.DialTimeout, opts.ReadTimeout, opts.WriteTimeout)
}
// go-redis dials up to five times by default; with Docker DNS taking
// seconds to give up on a stopped container that alone would exceed the
// request deadline.
if opts.DialerRetries != 1 {
t.Fatalf("DialerRetries = %d, want a single dial attempt", opts.DialerRetries)
}
// go-redis stores the requested -1 ("no retries") as 0 after init; its
// default would be 3.