Copilot commented on code in PR #7665:
URL: https://github.com/apache/ignite-3/pull/7665#discussion_r2853795007


##########
modules/platforms/dotnet/Apache.Extensions.Caching.Ignite.Tests/IgniteDistributedCacheTests.cs:
##########
@@ -276,21 +276,21 @@ public async Task TestSlidingExpiration()
 
         var entryOptions = new DistributedCacheEntryOptions
         {
-            SlidingExpiration = TimeSpan.FromSeconds(0.5)
+            SlidingExpiration = TimeSpan.FromSeconds(1)
         };
 
         await cache.SetAsync("x", [1], entryOptions);
         Assert.IsNotNull(await cache.GetAsync("x"));
 
         // Access before expiration to reset the timer.
-        for (int i = 0; i < 7; i++)
+        for (int i = 0; i < 15; i++)
         {
             await Task.Delay(TimeSpan.FromSeconds(0.1));
             Assert.IsNotNull(await cache.GetAsync("x"));
         }
 
         // Wait for expiration without accessing.
-        await Task.Delay(TimeSpan.FromSeconds(0.7));
+        await Task.Delay(TimeSpan.FromSeconds(1.5));
         Assert.IsNull(await cache.GetAsync("x"));

Review Comment:
   Consider using TestUtils.WaitForConditionAsync instead of fixed Task.Delay 
for the final expiration check. This would make the test more resilient to 
timing variations across different environments. The pattern is used in 
TestAbsoluteExpirationRelativeToNow (line 250) where expiration is checked with 
polling rather than a fixed delay.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to