dimas-b commented on code in PR #5129:
URL: https://github.com/apache/polaris/pull/5129#discussion_r3640542290


##########
polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java:
##########
@@ -442,6 +443,74 @@ private static List<StorageAccessConfig> 
getFakeAccessConfigs(int number, boolea
     return res;
   }
 
+  @Test
+  public void testRefreshBufferEvictsNearExpiryCredentials() {
+    // Credentials expire in 120 seconds from now.
+    // With a 300-second refresh buffer, effective TTL = 120s - 300s = -180s → 
clamped to 0.
+    // The entry must be absent immediately after load.
+    long expiresAt = System.currentTimeMillis() + 120_000;
+    StorageAccessConfig nearExpiryConfig =
+        StorageAccessConfig.builder()
+            .put(StorageAccessProperty.AWS_KEY_ID, "key")
+            .put(StorageAccessProperty.AWS_SECRET_KEY, "secret")
+            .put(
+                StorageAccessProperty.AWS_SESSION_TOKEN_EXPIRES_AT_MS,
+                String.valueOf(expiresAt))
+            .put(StorageAccessProperty.EXPIRATION_TIME, 
String.valueOf(expiresAt))

Review Comment:
   This will probably need to be reworked after #5070



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