You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by yu...@apache.org on 2026/06/11 15:11:59 UTC

(gravitino) branch branch-1.3 updated: [Cherry-pick to branch-1.3] [#11602] fix(test): Fix flaky TopicAuthorizationIT (#11607) (#11608)

This is an automated email from the ASF dual-hosted git repository.

yuqi1129 pushed a commit to branch branch-1.3
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-1.3 by this push:
     new b2fb414830 [Cherry-pick to branch-1.3] [#11602] fix(test): Fix flaky TopicAuthorizationIT (#11607) (#11608)
b2fb414830 is described below

commit b2fb4148303b4aa5dbc2e772797249b267caab7e
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Thu Jun 11 23:11:53 2026 +0800

    [Cherry-pick to branch-1.3] [#11602] fix(test): Fix flaky TopicAuthorizationIT (#11607) (#11608)
    
    **Cherry-pick Information:**
    - Original commit: b242db2f011e4fa4156675315a3c01707cb81241
    - Target branch: `branch-1.3`
    - Status: ✅ Clean cherry-pick (no conflicts)
    
    Co-authored-by: Qi Yu <yu...@datastrato.com>
---
 .../test/authorization/TopicAuthorizationIT.java   | 35 +++++++++++++---------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/authorization/TopicAuthorizationIT.java b/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/authorization/TopicAuthorizationIT.java
index 0e1f35bfc6..fb0a90036b 100644
--- a/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/authorization/TopicAuthorizationIT.java
+++ b/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/authorization/TopicAuthorizationIT.java
@@ -151,24 +151,31 @@ public class TopicAuthorizationIT extends BaseRestApiAuthorizationIT {
   @Order(2)
   public void testListTopic() {
     TopicCatalog topicCatalog = client.loadMetalake(METALAKE).loadCatalog(CATALOG).asTopicCatalog();
-    NameIdentifier[] topicsList = topicCatalog.listTopics(Namespace.of(SCHEMA));
-    assertArrayEquals(
-        new NameIdentifier[] {
-          NameIdentifier.of(SCHEMA, "topic1"),
-          NameIdentifier.of(SCHEMA, "topic2"),
-          NameIdentifier.of(SCHEMA, "topic3")
-        },
-        topicsList);
     // normal user can only see topics they have privilege for
     TopicCatalog topicCatalogNormalUser =
         normalUserClient.loadMetalake(METALAKE).loadCatalog(CATALOG).asTopicCatalog();
 
-    NameIdentifier[] topicsListNormalUser = topicCatalogNormalUser.listTopics(Namespace.of(SCHEMA));
-    assertArrayEquals(
-        new NameIdentifier[] {
-          NameIdentifier.of(SCHEMA, "topic2"), NameIdentifier.of(SCHEMA, "topic3")
-        },
-        topicsListNormalUser);
+    Awaitility.await()
+        .atMost(30, TimeUnit.SECONDS)
+        .untilAsserted(
+            () -> {
+              NameIdentifier[] topicsList = topicCatalog.listTopics(Namespace.of(SCHEMA));
+              assertArrayEquals(
+                  new NameIdentifier[] {
+                    NameIdentifier.of(SCHEMA, "topic1"),
+                    NameIdentifier.of(SCHEMA, "topic2"),
+                    NameIdentifier.of(SCHEMA, "topic3")
+                  },
+                  topicsList);
+
+              NameIdentifier[] topicsListNormalUser =
+                  topicCatalogNormalUser.listTopics(Namespace.of(SCHEMA));
+              assertArrayEquals(
+                  new NameIdentifier[] {
+                    NameIdentifier.of(SCHEMA, "topic2"), NameIdentifier.of(SCHEMA, "topic3")
+                  },
+                  topicsListNormalUser);
+            });
   }
 
   @Test