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


##########
modules/platforms/dotnet/Apache.Extensions.Caching.Ignite.Tests/IgniteDistributedCacheTests.cs:
##########
@@ -283,12 +283,11 @@ public async Task TestSlidingExpiration()
         Assert.IsNotNull(await cache.GetAsync("x"));
 
         // Access before expiration to reset the timer.
-        await Task.Delay(TimeSpan.FromSeconds(0.3));
-        Assert.IsNotNull(await cache.GetAsync("x"));
-
-        // Wait less than the sliding window - should still be available.
-        await Task.Delay(TimeSpan.FromSeconds(0.3));
-        Assert.IsNotNull(await cache.GetAsync("x"));
+        for (int i = 0; i < 7; i++)
+        {
+            await Task.Delay(TimeSpan.FromSeconds(0.1));
+            Assert.IsNotNull(await cache.GetAsync("x"));
+        }

Review Comment:
   The loop uses hardcoded values (7 iterations, 0.1 seconds) that are 
implicitly tied to the 0.5s SlidingExpiration above. Consider deriving the 
delay/iteration count from `entryOptions.SlidingExpiration` (and/or using 
`TimeSpan.FromMilliseconds(100)` with named constants) so the intent stays 
correct if the expiration duration changes later.



-- 
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