1
0
mirror of https://github.com/redis/go-redis.git synced 2025-10-18 22:08:50 +03:00

fix(test): fix flaky test

This commit is contained in:
Nedyalko Dyakov
2025-10-15 18:56:18 +03:00
parent 77c0c73b75
commit 011ef96716

View File

@@ -497,9 +497,14 @@ func TestDialerRetryConfiguration(t *testing.T) {
}
// Should have attempted 5 times (default DialerRetries = 5)
// Note: There may be one additional attempt from tryDial() goroutine
// which is launched when dialErrorsNum reaches PoolSize
finalAttempts := atomic.LoadInt64(&attempts)
if finalAttempts != 5 {
t.Errorf("Expected 5 dial attempts (default), got %d", finalAttempts)
if finalAttempts < 5 {
t.Errorf("Expected at least 5 dial attempts (default), got %d", finalAttempts)
}
if finalAttempts > 6 {
t.Errorf("Expected around 5 dial attempts, got %d (too many)", finalAttempts)
}
})
}