Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #8718] Fix flaky CreateAndUpdateTopicIT #8717

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

package org.apache.rocketmq.test.route;

import java.util.concurrent.TimeUnit;
import org.apache.rocketmq.common.TopicConfig;
import org.apache.rocketmq.remoting.protocol.route.TopicRouteData;
import org.apache.rocketmq.test.base.BaseConf;
import org.apache.rocketmq.test.util.MQAdminTestUtils;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

public class CreateAndUpdateTopicIT extends BaseConf {

Expand Down Expand Up @@ -60,11 +62,9 @@
boolean createResult = MQAdminTestUtils.createTopic(NAMESRV_ADDR, CLUSTER_NAME, testTopic1, 8, null);
assertThat(createResult).isTrue();


createResult = MQAdminTestUtils.createTopic(NAMESRV_ADDR, CLUSTER_NAME, testTopic2, 8, null);
assertThat(createResult).isTrue();


TopicRouteData route = MQAdminTestUtils.examineTopicRouteInfo(NAMESRV_ADDR, testTopic2);
assertThat(route.getBrokerDatas()).hasSize(3);

Expand All @@ -75,7 +75,9 @@

// The route info of testTopic2 will be removed from broker1 after the registration
route = MQAdminTestUtils.examineTopicRouteInfo(NAMESRV_ADDR, testTopic2);
assertThat(route.getBrokerDatas()).hasSize(2);

TopicRouteData finalRoute = route;
await().atMost(10, TimeUnit.SECONDS).until(() -> finalRoute.getBrokerDatas().size() == 2);

Check failure on line 80 in test/src/test/java/org/apache/rocketmq/test/route/CreateAndUpdateTopicIT.java

View workflow job for this annotation

GitHub Actions / maven-compile (ubuntu-latest, JDK-8)

CreateAndUpdateTopicIT.testDeleteTopicFromNameSrvWithBrokerRegistration

Condition with lambda expression in org.apache.rocketmq.test.route.CreateAndUpdateTopicIT that uses org.apache.rocketmq.remoting.protocol.route.TopicRouteData was not fulfilled within 10 seconds.
assertThat(route.getQueueDatas().get(0).getBrokerName()).isEqualTo(BROKER2_NAME);
assertThat(route.getQueueDatas().get(1).getBrokerName()).isEqualTo(BROKER3_NAME);

Expand Down
Loading