yuqi1129 commented on code in PR #11310:
URL: https://github.com/apache/gravitino/pull/11310#discussion_r3332072116


##########
core/src/test/java/org/apache/gravitino/storage/TestEntityStorageRelationCache.java:
##########
@@ -1468,6 +1468,148 @@ void testFunctionOwnerRelationCacheInvalidation(String 
type, boolean enableCache
     }
   }
 
+  /**
+   * Reproduces GitHub issue #11297: after {@code revokePrivilegesFromRole} 
removes the last
+   * privilege from a role's securable schema, {@code
+   * listEntitiesByRelation(METADATA_OBJECT_ROLE_REL)} must not return the 
stale role from cache.
+   *
+   * <p>Flow: create schema + role → list binding roles (populates cache) → 
update role to remove
+   * securable object (simulates revoke) → list binding roles again → must 
reflect the change.
+   */
+  @ParameterizedTest
+  @MethodSource("storageProvider")
+  void testRevokePrivilegeInvalidatesMetadataObjectRoleRelCache(String type, 
boolean enableCache)
+      throws Exception {
+    Config config = Mockito.mock(Config.class);
+    Mockito.when(config.get(Configs.CACHE_ENABLED)).thenReturn(enableCache);
+    init(type, config);

Review Comment:
   No need to change.



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