From 4f91eac4d7321f9674e63118ca5cfb193c35f875 Mon Sep 17 00:00:00 2001
From: sukreshmanda <mandasukresh@gmail.com>
Date: Mon, 29 Jul 2024 16:27:40 +0530
Subject: [PATCH] Fix warnings for s6603

---
 test/Polly.Specs/RateLimit/RateLimitPolicySpecsBase.cs        | 4 +---
 test/Polly.Specs/RateLimit/TokenBucketRateLimiterTestsBase.cs | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/test/Polly.Specs/RateLimit/RateLimitPolicySpecsBase.cs b/test/Polly.Specs/RateLimit/RateLimitPolicySpecsBase.cs
index 448d6e65b51..14e322f9fea 100644
--- a/test/Polly.Specs/RateLimit/RateLimitPolicySpecsBase.cs
+++ b/test/Polly.Specs/RateLimit/RateLimitPolicySpecsBase.cs
@@ -294,9 +294,7 @@ public void Given_immediate_parallel_contention_ratelimiter_still_only_permits_o
 
         // Act - release gate.
         gate.Set();
-#pragma warning disable S6603
-        Within(TimeSpan.FromSeconds(10 /* high to allow for slow-running on time-slicing CI servers */), () => tasks.All(t => t.IsCompleted).Should().BeTrue());
-#pragma warning restore S6603
+        Within(TimeSpan.FromSeconds(10 /* high to allow for slow-running on time-slicing CI servers */), () => tasks.ToList().TrueForAll(t => t.IsCompleted).Should().BeTrue());
 
         // Assert - one should have permitted execution, n-1 not.
         var results = tasks.Select(t => t.Result).ToList();
diff --git a/test/Polly.Specs/RateLimit/TokenBucketRateLimiterTestsBase.cs b/test/Polly.Specs/RateLimit/TokenBucketRateLimiterTestsBase.cs
index 18aa01a3a9a..153571b62ec 100644
--- a/test/Polly.Specs/RateLimit/TokenBucketRateLimiterTestsBase.cs
+++ b/test/Polly.Specs/RateLimit/TokenBucketRateLimiterTestsBase.cs
@@ -193,9 +193,7 @@ public void Given_immediate_parallel_contention_ratelimiter_still_only_permits_o
 
         // Act - release gate.
         gate.Set();
-#pragma warning disable S6603
-        Within(TimeSpan.FromSeconds(10 /* high to allow for slow-running on time-slicing CI servers */), () => tasks.All(t => t.IsCompleted).Should().BeTrue());
-#pragma warning restore S6603
+        Within(TimeSpan.FromSeconds(10 /* high to allow for slow-running on time-slicing CI servers */), () => tasks.ToList().TrueForAll(t => t.IsCompleted).Should().BeTrue());
 
         // Assert - one should have permitted execution, n-1 not.
         var results = tasks.Select(t => t.Result).ToList();