You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2021/12/21 01:33:37 UTC
[pulsar] 01/18: [Issue 12897] Fix flaky test in testReplicatorProducerName (#12898)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit fbadbd07b1fb335ae8db3d4a64ece4fdaf31dbad
Author: JiangHaiting <ji...@apache.org>
AuthorDate: Sun Nov 21 12:49:15 2021 +0800
[Issue 12897] Fix flaky test in testReplicatorProducerName (#12898)
(cherry picked from commit 78c2981a8bc0af4ee883357b99a40e83be8ffa4b)
---
.../java/org/apache/pulsar/broker/service/ReplicatorTest.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
index 87e2730..488fbfe 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
@@ -730,10 +730,12 @@ public class ReplicatorTest extends ReplicatorTestBase {
});
Optional<Topic> topic = pulsar2.getBrokerService().getTopicReference(topicName);
assertTrue(topic.isPresent());
- Set<String> remoteClusters = topic.get().getProducers().values().stream()
- .map(org.apache.pulsar.broker.service.Producer::getRemoteCluster)
- .collect(Collectors.toSet());
- assertTrue(remoteClusters.contains("r1"));
+ Awaitility.await().untilAsserted(() -> {
+ Set<String> remoteClusters = topic.get().getProducers().values().stream()
+ .map(org.apache.pulsar.broker.service.Producer::getRemoteCluster)
+ .collect(Collectors.toSet());
+ assertTrue(remoteClusters.contains("r1"));
+ });
}
@Test(priority = 5, timeOut = 30000)