yuqi1129 commented on code in PR #11607:
URL: https://github.com/apache/gravitino/pull/11607#discussion_r3395664221
##########
clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/authorization/TopicAuthorizationIT.java:
##########
@@ -151,24 +151,31 @@ public void testCreateTopic() {
@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"),
Review Comment:
It's acceptable as it's the same as before.
##########
clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/authorization/TopicAuthorizationIT.java:
##########
@@ -151,24 +151,31 @@ public void testCreateTopic() {
@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")
+ },
Review Comment:
ditto
--
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]