diff --git a/internal/pool/pool_test.go b/internal/pool/pool_test.go index ef1ed5f9..6aa6dc09 100644 --- a/internal/pool/pool_test.go +++ b/internal/pool/pool_test.go @@ -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) } }) }