1
0
mirror of https://github.com/redis/go-redis.git synced 2025-12-18 23:34:11 +03:00

fix(retry): Add retry mechanism for NOREPLICAS error (#3647)

This commit is contained in:
ofekshenawa
2025-12-10 18:14:05 +02:00
committed by GitHub
parent e4965ea90b
commit 4edf494293
5 changed files with 78 additions and 12 deletions

View File

@@ -239,10 +239,10 @@ func TestErrorWrappingInHookScenario(t *testing.T) {
// TestShouldRetryWithTypedErrors tests that shouldRetry works with typed errors
func TestShouldRetryWithTypedErrors(t *testing.T) {
tests := []struct {
name string
errorMsg string
shouldRetry bool
retryTimeout bool
name string
errorMsg string
shouldRetry bool
retryTimeout bool
}{
{
name: "LOADING error should retry",
@@ -280,6 +280,12 @@ func TestShouldRetryWithTypedErrors(t *testing.T) {
shouldRetry: true,
retryTimeout: false,
},
{
name: "NOREPLICAS error should retry",
errorMsg: "NOREPLICAS Not enough good replicas to write",
shouldRetry: true,
retryTimeout: false,
},
}
for _, tt := range tests {