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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user